Update nix flake

This commit is contained in:
2025-01-07 20:55:31 +03:00
parent ba2f5da3ac
commit 7fd6d66a12

View File

@@ -41,7 +41,6 @@
}; };
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;
@@ -84,25 +83,22 @@
config = lib.mkIf config.photocatalog.enable { config = lib.mkIf config.photocatalog.enable {
environment.systemPackages = [ self.packages.${pkgs.system}.photocatalog ]; environment.systemPackages = [ self.packages.${pkgs.system}.photocatalog ];
systemd.services = lib.mapAttrs' (name: sync: nameValuePair ("photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}") systemd.services = lib.mapAttrs' (name: sync: {
{ after = [ "local-fs.target" ];
# name = "photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}"; path = [
after = [ "local-fs.target" ]; pkgs.photocatalog
path = [ ];
packages.photocatalog preStart = if !sync.skipFullSync then ''
]; mkdir -p ${sync.target}
preStart = if !sync.skipFullSync then '' photocatalog -source ${sync.source} -target ${sync.target}
mkdir -p ${sync.target} '' else null;
photocatalog -source ${sync.source} -target ${sync.target} script = "photocatalog";
'' else null; scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch";
script = "photocatalog"; serviceConfig = {
scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch"; Type = "simple";
serviceConfig = { Restart = "no";
Type="simple"; };
Restart="no"; }) config.photocatalog.syncs;
};
}
) config.photocatalog.syncs;
}; };
}; };