From 7f78cd20fd376c33952de2f4b6df7b501e1c10bc Mon Sep 17 00:00:00 2001 From: James Atkins Date: Sun, 9 Jun 2024 12:21:51 -0500 Subject: [PATCH] nixos/changedetection-io: fix creation of data dir Create data directory using tmpfiles if it is not in the standard location. Do not run mkdir manually. --- nixos/modules/services/web-apps/changedetection-io.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/modules/services/web-apps/changedetection-io.nix b/nixos/modules/services/web-apps/changedetection-io.nix index f0d72b1e4d69..32448486cc95 100644 --- a/nixos/modules/services/web-apps/changedetection-io.nix +++ b/nixos/modules/services/web-apps/changedetection-io.nix @@ -129,9 +129,6 @@ in services.changedetection-io = { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - preStart = '' - mkdir -p ${cfg.datastorePath} - ''; serviceConfig = { User = cfg.user; Group = cfg.group; @@ -153,7 +150,7 @@ in Restart = "on-failure"; }; }; - tmpfiles.rules = mkIf defaultStateDir [ + tmpfiles.rules = mkIf (!defaultStateDir) [ "d ${cfg.datastorePath} 0750 ${cfg.user} ${cfg.group} - -" ]; };