mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
nixos/services: add path assertions
This commit is contained in:
parent
342e1b11f1
commit
d111304d71
@ -166,6 +166,10 @@ in {
|
|||||||
SystemCallFilter = "@system-service";
|
SystemCallFilter = "@system-service";
|
||||||
SystemCallErrorNumber = "EPERM";
|
SystemCallErrorNumber = "EPERM";
|
||||||
};
|
};
|
||||||
|
unitConfig = {
|
||||||
|
AssertPathIsReadWrite = cfg.archivePath;
|
||||||
|
AssertPathIsDirectory = cfg.archivePath;
|
||||||
|
};
|
||||||
}) cfg.jobs;
|
}) cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,8 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# There's no need to go to the working directory since yt-dlp has the
|
||||||
|
# `--paths` flag.
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.services = lib.mapAttrs' (name: value:
|
systemd.services = lib.mapAttrs' (name: value:
|
||||||
lib.nameValuePair "yt-dlp-archive-service-${name}" {
|
lib.nameValuePair "yt-dlp-archive-service-${name}" {
|
||||||
@ -142,6 +144,10 @@ in {
|
|||||||
SystemCallFilter = "@system-service";
|
SystemCallFilter = "@system-service";
|
||||||
SystemCallErrorNumber = "EPERM";
|
SystemCallErrorNumber = "EPERM";
|
||||||
};
|
};
|
||||||
|
unitConfig = {
|
||||||
|
AssertPathIsReadWrite = cfg.archivePath;
|
||||||
|
AssertPathIsDirectory = cfg.archivePath;
|
||||||
|
};
|
||||||
}) cfg.jobs;
|
}) cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user