1 { pkgs, lib, config, ... }:
3 # none is the recommended elevator with ZFS (which has its own I/O scheduler)
4 # and/or for SSD, whereas HDD could use mq-deadline.
5 services.udev.extraRules = ''
6 # set none scheduler for non-rotating disks
7 ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"
8 ACTION=="add|change", KERNEL=="nvme[0-9]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"
11 boot.supportedFilesystems = [ "zfs" ];
13 # Ensure extra safeguards are active that zfs uses to protect zfs pools.
14 boot.zfs.forceImportAll = false;
15 boot.zfs.forceImportRoot = false;
17 boot.zfs.enableUnstable = true;
18 boot.zfs.requestEncryptionCredentials = true;
20 # Enables periodic scrubbing of ZFS pools.
21 services.zfs.autoScrub.enable = true;