All modules with preStart: Use systemd.tmpfiles.rules

This is NixOS' recommended way to setup service dirs
https://github.com/NixOS/nixpkgs/pull/56265. This commit hands off the
initial data directory creation to systemd.tmpfiles.rules. All other
preStart scripts are left intact to limit this changes' scope.
This commit is contained in:
nixbitcoin
2020-05-22 14:54:39 +00:00
parent 423ebf862b
commit 91b6b2c370
8 changed files with 31 additions and 18 deletions
+4 -1
View File
@@ -15,7 +15,6 @@ let
# wait until tor is up
until ls -l /var/lib/tor/state; do sleep 1; done
mkdir -p -m 0755 ${dataDir}
cd ${dataDir}
# Create directory for every user and set permissions
@@ -68,6 +67,10 @@ in {
};
config = mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d '${dataDir}' 0755 root root - -"
];
systemd.services.onion-chef = {
description = "Run onion-chef";
wantedBy = [ "tor.service" ];