1 { config, lib, pkgs, ... }:
4 let cfg = config.services.phylactery;
6 options.services.phylactery = {
7 enable = mkEnableOption "Phylactery server";
11 default = "localhost";
12 description = "Listen host for Phylactery";
17 description = "Listen port for Phylactery";
22 description = "Path to CBZ library";
25 package = mkPackageOption pkgs "phylactery" { };
28 config = mkIf cfg.enable {
29 systemd.services.phylactery = {
31 PHYLACTERY_ADDRESS = "${cfg.host}:${toString cfg.port}";
32 PHYLACTERY_LIBRARY = "${cfg.library}";
35 wantedBy = [ "multi-user.target" ];
38 ConditionPathExists = cfg.library;
40 ExecStart = "${cfg.package}/bin/phylactery";
45 meta.maintainers = with maintainers; [ McSinyx ];