Update nix flake

This commit is contained in:
2025-01-07 20:58:04 +03:00
parent 7fd6d66a12
commit d20a64206d

View File

@@ -41,6 +41,7 @@
}; };
type = types.attrsOf (types.submodule ({ name, ... }: { type = types.attrsOf (types.submodule ({ name, ... }: {
# freeformType = settingsFormat.type;
options = { options = {
source = mkOption { source = mkOption {
type = types.str; type = types.str;
@@ -82,23 +83,26 @@
}; };
config = lib.mkIf config.photocatalog.enable { config = lib.mkIf config.photocatalog.enable {
environment.systemPackages = [ self.packages.${pkgs.system}.photocatalog ]; environment.systemPackages = [ pkgs.photocatalog ];
systemd.services = lib.mapAttrs' (name: sync: { systemd.services = lib.mapAttrs' (name: sync: nameValuePair ("photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}")
after = [ "local-fs.target" ]; {
path = [ # name = "photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}";
pkgs.photocatalog after = [ "local-fs.target" ];
]; path = [
preStart = if !sync.skipFullSync then '' pkgs.photocatalog
mkdir -p ${sync.target} ];
photocatalog -source ${sync.source} -target ${sync.target} preStart = if !sync.skipFullSync then ''
'' else null; mkdir -p ${sync.target}
script = "photocatalog"; photocatalog -source ${sync.source} -target ${sync.target}
scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch"; '' else null;
serviceConfig = { script = "photocatalog";
Type = "simple"; scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch";
Restart = "no"; serviceConfig = {
}; Type="simple";
}) config.photocatalog.syncs; Restart="no";
};
}
) config.photocatalog.syncs;
}; };
}; };