anchor.diff:          };
         };
       })
  +
  +    (mkIf cfgTrim.enable {
  +      systemd.services.zpool-trim = {
  +        description = "ZFS pools trim";
  +        after = [ "zfs-import.target" ];
  +        path = [ packages.zfsUser ];
  +        startAt = cfgTrim.interval;
  +        script = ''
  +          zpool list -H -o name | xargs -n1 zpool trim
  +        '';
  +      };
  +    })
     ];
   }
  
positive.code:       };
      };
  
      services.zfs.autoScrub = {
        enable = mkOption {
          default = false;
          type = types.bool;
          description = ''
            Enables periodic scrubbing of ZFS pools.
          '';
        };
  
        interval = mkOption {
          default = "Sun, 02:00";
  
negative.code:   cfgSnapshots = config.services.zfs.autoSnapshot;
    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;
  