Update nix flake

This commit is contained in:
2025-01-07 21:02:49 +03:00
parent a1cafdfb8b
commit ffe9bfe466
2 changed files with 12 additions and 2 deletions

View File

@@ -77,6 +77,13 @@
Do not make full sync. Do not make full sync.
''; '';
}; };
mode = mkOption {
type = types.str;
default = "hardlink";
description = ''
Organization mode, one of [ hardlink symlink move copy ].
'';
};
}; };
})); }));
}; };
@@ -95,8 +102,7 @@
mkdir -p ${sync.target} mkdir -p ${sync.target}
photocatalog -source ${sync.source} -target ${sync.target} photocatalog -source ${sync.source} -target ${sync.target}
'' else null; '' else null;
script = "photocatalog"; script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}";
scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch";
serviceConfig = { serviceConfig = {
Type="simple"; Type="simple";
Restart="no"; Restart="no";

View File

@@ -67,6 +67,10 @@ func loadCfg() application.Config {
}) })
flag.Func("mode", "Organizing mode", func(s string) error { flag.Func("mode", "Organizing mode", func(s string) error {
if s == "" {
}
cfg.Mode = application.Mode(s) cfg.Mode = application.Mode(s)
if !slices.Contains(application.SupportedModes, cfg.Mode) { if !slices.Contains(application.SupportedModes, cfg.Mode) {