anchor.diff:      }
     '';
   
  +  zedConf = generators.toKeyValue {
  +    mkKeyValue = generators.mkKeyValueDefault {
  +      mkValueString = v:
  +        if isInt           v then toString v
  +        else if isString   v then "\"${v}\""
  +        else if true  ==   v then "1"
  +        else if false ==   v then "0"
  +        else if isList     v then "\"" + (concatStringsSep " " v) + "\""
  +        else err "this value is" (toString v);
  +    } "=";
  +  } cfgZED.settings;
   in
   
   {
  
positive.code:   cfgSnapFlags = cfgSnapshots.flags;
    cfgScrub = config.services.zfs.autoScrub;
    cfgTrim = config.services.zfs.trim;
  
    inInitrd = any (fs: fs == "zfs") config.boot.initrd.supportedFilesystems;
    inSystem = any (fs: fs == "zfs") config.boot.supportedFilesystems;
  
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 ]
  