{ pkgs, lib, config, ... }: { imports = []; boot.supportedFilesystems = [ "zfs" ]; # The 32-bit host id of the machine, formatted as 8 hexadecimal characters. # You should try to make this id unique among your machines. # Manually generated with : head -c4 /dev/urandom | od -A none -t x4 | cut -d ' ' -f 2 networking.hostId = "69c40b03"; # noop is the recommended elevator with zfs. boot.kernelParams = [ "elevator=noop" ]; # Ensure extra safeguards are active that zfs uses to protect zfs pools. boot.zfs.forceImportAll = false; boot.zfs.forceImportRoot = false; boot.zfs.enableUnstable = true; boot.zfs.requestEncryptionCredentials = true; # Enables periodic scrubbing of ZFS pools. services.zfs.autoScrub.enable = true; environment = { systemPackages = [ pkgs.mbuffer pkgs.zfs ]; }; /* # Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service. services.zfs.autoSnapshot = { enable = true; frequent = ; hourly = ; daily = ; weekly = ; monthly = ; }; */ /* fileSystems."/boot" = { device = "bpool/boot"; fsType = "zfs"; }; */ fileSystems."/" = { device = "rpool/root"; fsType = "zfs"; }; fileSystems."/home" = { device = "rpool/home"; fsType = "zfs"; }; fileSystems."/nix" = { device = "rpool/nix"; fsType = "zfs"; }; fileSystems."/nix/var" = { device = "rpool/nix/var"; fsType = "zfs"; }; fileSystems."/var" = { device = "rpool/var"; fsType = "zfs"; }; fileSystems."/var/cache" = { device = "rpool/var/cache"; fsType = "zfs"; }; fileSystems."/var/log" = { device = "rpool/var/log"; fsType = "zfs"; }; fileSystems."/var/mail" = { device = "rpool/var/mail"; fsType = "zfs"; }; fileSystems."/var/tmp" = { device = "rpool/var/tmp"; fsType = "zfs"; }; fileSystems."/var/www" = { device = "rpool/var/www"; fsType = "zfs"; }; }