From 43c247e3fe3b2a8f635373a4278ba990694b330a Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jan 2021 13:24:11 +0100 Subject: [PATCH] onionAddresses: use StateDirectory instead of tmpfiles Simplifies the dataDir setup. --- modules/onion-addresses.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/onion-addresses.nix b/modules/onion-addresses.nix index 01d6ba0..27d20e3 100644 --- a/modules/onion-addresses.nix +++ b/modules/onion-addresses.nix @@ -68,10 +68,6 @@ in { }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = [ - "d '${dataDir}' 0755 root root - -" - ]; - systemd.services.onion-addresses = { description = "Run onion-addresses"; wantedBy = [ "tor.service" ]; @@ -81,9 +77,9 @@ in { ExecStart = "${pkgs.bash}/bin/bash ${onion-addresses-script}"; Type = "oneshot"; RemainAfterExit = true; + StateDirectory = "onion-addresses"; PrivateNetwork = "true"; # This service needs no network access PrivateUsers = "false"; - ReadWritePaths = "${dataDir}"; CapabilityBoundingSet = "CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER"; }; };