nixos/zfs: assert that zed.enableMail is only being used when sendmailSetuidWrapper is enabled

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
This commit is contained in:
Sandro Jäckel
2026-03-08 01:15:20 +01:00
parent abcecff5e8
commit 9173118034
+4
View File
@@ -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 = {