diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index b750820bfa5..f153cce4c72 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -326,30 +326,34 @@ in
};
};
- services.zfs.zed.settings = mkOption {
- type = with types; attrsOf (oneOf [ str int bool (listOf str) ]);
- example = literalExample ''
- {
- ZED_DEBUG_LOG = "/tmp/zed.debug.log";
+ services.zfs.zed = {
+ enableMail = mkEnableOption "ZED's ability to send emails";
- ZED_EMAIL_ADDR = [ "root" ];
- ZED_EMAIL_PROG = "mail";
- ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@";
+ settings = mkOption {
+ type = with types; attrsOf (oneOf [ str int bool (listOf str) ]);
+ example = literalExample ''
+ {
+ ZED_DEBUG_LOG = "/tmp/zed.debug.log";
- ZED_NOTIFY_INTERVAL_SECS = 3600;
- ZED_NOTIFY_VERBOSE = false;
+ ZED_EMAIL_ADDR = [ "root" ];
+ ZED_EMAIL_PROG = "mail";
+ ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@";
- ZED_USE_ENCLOSURE_LEDS = true;
- ZED_SCRUB_AFTER_RESILVER = false;
- }
- '';
- description = ''
- ZFS Event Daemon /etc/zfs/zed.d/zed.rc content
+ ZED_NOTIFY_INTERVAL_SECS = 3600;
+ ZED_NOTIFY_VERBOSE = false;
- See
- zed8
- for details on ZED and the scripts in /etc/zfs/zed.d to find the possible variables
- '';
+ ZED_USE_ENCLOSURE_LEDS = true;
+ ZED_SCRUB_AFTER_RESILVER = false;
+ }
+ '';
+ description = ''
+ ZFS Event Daemon /etc/zfs/zed.d/zed.rc content
+
+ See
+ zed8
+ for details on ZED and the scripts in /etc/zfs/zed.d to find the possible variables
+ '';
+ };
};
};
@@ -437,7 +441,7 @@ in
};
services.zfs.zed.settings = {
- ZED_EMAIL_PROG = mkDefault "${pkgs.mailutils}/bin/mail";
+ ZED_EMAIL_PROG = mkIf cfgZED.enableMail (mkDefault "${pkgs.mailutils}/bin/mail");
PATH = lib.makeBinPath [
cfgZfs.package
pkgs.coreutils