From 986d16addff26bbfc508af06787fcd18a479b185 Mon Sep 17 00:00:00 2001 From: derfenix Date: Tue, 7 Jan 2025 22:08:09 +0300 Subject: [PATCH] Add overwrite option to systemd service in flake --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d380cd5..b269d86 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ outputs = { self, nixpkgs }: let lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; - version = "2.0.2"; + version = "2.0.4"; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); @@ -100,11 +100,11 @@ wantedBy = [ "default.target" ]; - preStart = if !sync.skipFullSync then '' + preStart = if !sync.skipFullSync then ('' mkdir -p ${sync.target} photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode} - '' else null; - script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}"; + '' ++ lib.mkIf sync.overwrite "-overwrite") else null; + script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}" ++ lib.mkIf sync.overwrite "-overwrite"; serviceConfig = { Type="simple"; Restart="no";