From 5d9ce829eae997e3333048c2e9cd9726bd3ad7e0 Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 9 Nov 2024 21:47:54 +0000 Subject: [PATCH] smartd: only enable postfix integration IF postfix is enabled --- hosts/common/programs/smartmontools.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosts/common/programs/smartmontools.nix b/hosts/common/programs/smartmontools.nix index 9f9a94ba3..efdf6ebb7 100644 --- a/hosts/common/programs/smartmontools.nix +++ b/hosts/common/programs/smartmontools.nix @@ -54,7 +54,9 @@ in # keep "@privileged" or "@raw-io", since it needs to do that ]; # serviceConfig.RestrictNamespaces = true; - serviceConfig.ReadWritePaths = "/var/lib/postfix/queue/maildrop"; + serviceConfig.ReadWritePaths = lib.mkIf config.services.postfix.enable [ + "/var/lib/postfix/queue/maildrop" + ]; # serviceConfig.PrivateUsers = true; # can't, because it requires CAP_SYS_RAWIO }; }