From 91731180346ce833dee29665b850b6dc03341a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 18 Dec 2025 23:56:48 +0100 Subject: [PATCH] nixos/zfs: assert that zed.enableMail is only being used when sendmailSetuidWrapper is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we crash like: … while selecting an attribute at /nix/store/0b202s06rfm1vlyai37gd0zmzxg59qj0-source/nixos/modules/tasks/filesystems/zfs.nix:827:48: 826| lib.mkDefault ( 827| config.security.wrapperDir + "/" + config.services.mail.sendmailSetuidWrapper.program | ^ 828| ) error: expected a set but found null: null --- nixos/modules/tasks/filesystems/zfs.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 861c8ac8081e..0f91848a4bd0 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -696,6 +696,10 @@ in This error can be triggered by using an absolute path, such as `"/dev/disk/..."`. ''; } + { + assertion = cfgZED.enableMail -> config.services.mail.sendmailSetuidWrapper.enable; + message = "services.zfs.zed.enableMail requires services.mail.sendmailSetuidWrapper.enable to be enabled as otherwise no mail can be sent."; + } ]; boot = {