From ffe9bfe466497a37694761a39d05f380a17612f2 Mon Sep 17 00:00:00 2001 From: derfenix Date: Tue, 7 Jan 2025 21:02:49 +0300 Subject: [PATCH] Update nix flake --- flake.nix | 10 ++++++++-- main.go | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 0bb9f40..cf6dcdd 100644 --- a/flake.nix +++ b/flake.nix @@ -77,6 +77,13 @@ 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} photocatalog -source ${sync.source} -target ${sync.target} '' else null; - script = "photocatalog"; - scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch"; + script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}"; serviceConfig = { Type="simple"; Restart="no"; diff --git a/main.go b/main.go index 3d6e3da..34348dd 100644 --- a/main.go +++ b/main.go @@ -67,6 +67,10 @@ func loadCfg() application.Config { }) flag.Func("mode", "Organizing mode", func(s string) error { + if s == "" { + + } + cfg.Mode = application.Mode(s) if !slices.Contains(application.SupportedModes, cfg.Mode) {