From d20a64206d85ca59179350c5b2a34cb8959c08f8 Mon Sep 17 00:00:00 2001 From: derfenix Date: Tue, 7 Jan 2025 20:58:04 +0300 Subject: [PATCH] Update nix flake --- flake.nix | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 4ca6867..5537a48 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,7 @@ }; type = types.attrsOf (types.submodule ({ name, ... }: { +# freeformType = settingsFormat.type; options = { source = mkOption { type = types.str; @@ -82,23 +83,26 @@ }; config = lib.mkIf config.photocatalog.enable { - environment.systemPackages = [ self.packages.${pkgs.system}.photocatalog ]; - systemd.services = lib.mapAttrs' (name: sync: { - after = [ "local-fs.target" ]; - path = [ - pkgs.photocatalog - ]; - preStart = if !sync.skipFullSync then '' - mkdir -p ${sync.target} - photocatalog -source ${sync.source} -target ${sync.target} - '' else null; - script = "photocatalog"; - scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch"; - serviceConfig = { - Type = "simple"; - Restart = "no"; - }; - }) config.photocatalog.syncs; + environment.systemPackages = [ pkgs.photocatalog ]; + systemd.services = lib.mapAttrs' (name: sync: nameValuePair ("photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}") + { +# name = "photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}"; + after = [ "local-fs.target" ]; + path = [ + pkgs.photocatalog + ]; + preStart = if !sync.skipFullSync then '' + mkdir -p ${sync.target} + photocatalog -source ${sync.source} -target ${sync.target} + '' else null; + script = "photocatalog"; + scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch"; + serviceConfig = { + Type="simple"; + Restart="no"; + }; + } + ) config.photocatalog.syncs; }; };