1 { pkgs, lib, config, ... }:
6 boot.supportedFilesystems = [ "zfs" ];
8 # The 32-bit host id of the machine, formatted as 8 hexadecimal characters.
9 # You should try to make this id unique among your machines.
10 # Manually generated with : head -c4 /dev/urandom | od -A none -t x4 | cut -d ' ' -f 2
11 networking.hostId = "69c40b03";
13 # noop is the recommended elevator with zfs.
18 # Ensure extra safeguards are active that zfs uses to protect zfs pools.
19 boot.zfs.forceImportAll = false;
20 boot.zfs.forceImportRoot = false;
22 boot.zfs.enableUnstable = true;
23 boot.zfs.requestEncryptionCredentials = true;
25 # Enables periodic scrubbing of ZFS pools.
26 services.zfs.autoScrub.enable = true;
36 # Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service.
37 services.zfs.autoSnapshot = {
49 { device = "bpool/boot";
54 { device = "rpool/root";
59 { device = "rpool/home";
64 { device = "rpool/nix";
68 fileSystems."/nix/var" =
69 { device = "rpool/nix/var";
74 { device = "rpool/var";
78 fileSystems."/var/cache" =
79 { device = "rpool/var/cache";
83 fileSystems."/var/log" =
84 { device = "rpool/var/log";
88 fileSystems."/var/mail" =
89 { device = "rpool/var/mail";
93 fileSystems."/var/tmp" =
94 { device = "rpool/var/tmp";
98 fileSystems."/var/www" =
99 { device = "rpool/var/www";