anchor.diff:            will be scrubbed.
           '';
         };
  +    };
  +
  +    services.zfs.zed.settings = mkOption {
  +      type = with types; attrsOf (oneOf [ str int bool (listOf str) ]);
  +      example = literalExample ''
  +        {
  +          ZED_DEBUG_LOG = "/tmp/zed.debug.log";
  +
  +          ZED_EMAIL_ADDR = [ "root" ];
  +          ZED_EMAIL_PROG = "mail";
  +          ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@";
  +
  +          ZED_NOTIFY_INTERVAL_SECS = 3600;
  +          ZED_NOTIFY_VERBOSE = false;
  +
  +          ZED_USE_ENCLOSURE_LEDS = true;
  +          ZED_SCRUB_AFTER_RESILVER = false;
  +        }
  +      '';
  +      description = ''
  +        ZFS Event Daemon /etc/zfs/zed.d/zed.rc content
  +
  +        See
  +        <citerefentry><refentrytitle>zed</refentrytitle><manvolnum>8</manvolnum></citerefentry>
  +        for details on ZED and the scripts in /etc/zfs/zed.d to find the possible variables
  +      '';
       };
     };
   
  
positive.code:     }
    '';
  
  in
  
  {
  
negative.code:         zfsSupport = true;
        };
  
        services.zfs.zed.settings = {
          ZED_EMAIL_PROG = mkDefault "${pkgs.mailutils}/bin/mail";
        };
  
        environment.etc = genAttrs
          (map
            (file: "zfs/zed.d/${file}")
            [
              "all-syslog.sh"
              "pool_import-led.sh"
              "resilver_finish-start-scrub.sh"
              "statechange-led.sh"
              "vdev_attach-led.sh"
              "zed-functions.sh"
              "data-notify.sh"
              "resilver_finish-notify.sh"
              "scrub_finish-notify.sh"
              "statechange-notify.sh"
              "vdev_clear-led.sh"
            ]
          )
          (file: { source = "${packages.zfsUser}/etc/${file}"; })
        // {
          "zfs/zed.d/zed.rc".text = zedConf;
          "zfs/zpool.d".source = "${packages.zfsUser}/etc/zfs/zpool.d/";
        };
  
        system.fsPackages = [ packages.zfsUser ]; # XXX: needed? zfs doesn't have (need) a fsck
        environment.systemPackages = [ packages.zfsUser ]
  