flake: Improve service preStart

This commit is contained in:
2025-01-07 22:40:48 +03:00
parent 0cf9b85787
commit 438cd3d86f

View File

@@ -100,10 +100,11 @@
wantedBy = [
"default.target"
];
preStart = if !sync.skipFullSync then (''
preStart = ''
mkdir -p ${sync.target}
'' ++ (if !sync.skipFullSync then (''
photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}
'') else null;
'') else null);
script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}";
serviceConfig = {
Type="simple";