7 Commits

View File

@@ -6,7 +6,7 @@
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; 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" ]; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
@@ -77,7 +77,7 @@
''; '';
}; };
mode = mkOption { mode = mkOption {
type = types.str; type = types.enum [ "hardlink" "symlink" "move" "copy" ];
default = "hardlink"; default = "hardlink";
description = '' description = ''
Organization mode, one of [ hardlink symlink move copy ]. Organization mode, one of [ hardlink symlink move copy ].
@@ -100,11 +100,12 @@
wantedBy = [ wantedBy = [
"default.target" "default.target"
]; ];
preStart = if !sync.skipFullSync then '' preStart = ''
mkdir -p ${sync.target} mkdir -p ${sync.target}
photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode} '' + (if !sync.skipFullSync then (''
'' else null; photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}
script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}"; '') else null);
script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}";
serviceConfig = { serviceConfig = {
Type="simple"; Type="simple";
Restart="no"; Restart="no";