{ config, lib, pkgs, ... }: { imports = []; boot.supportedFilesystems = [ "zfs" ]; boot.loader = { /* efi = { canTouchEfiVariables = true; efiSysMountPoint = "/boot/efi"; efiInstallAsRemovable = false; }; */ grub = { enable = true; version = 2; copyKernels = true; # efiSupport = true; devices = [ "/dev/disk/by-id/ata-Samsung_SSD_840_EVO_250GB_S1DBNSAF340110R" ]; /* mirroredBoots = [ $(bootnum="" for disk_id in "${zfs_pool_disks[@]}" do echo "" ((bootnum++)) done) { devices = [ "${disk_id}" ]; path = "/boot${bootnum}"; } ]; */ }; }; # 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, the recommended elevator with zfs. # shell_on_fail allows to force import manually in the case of zfs import failure. boot.kernelParams = [ "elevator=noop" "boot.shell_on_fail" ]; # FIXME: Uncomment [on a working system] to 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; /* # Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service. services.zfs.autoSnapshot = { enable = true; frequent = ; hourly = ; daily = ; weekly = ; monthly = ; }; */ /* etc/systemd/system/zfs-import-bpool.service [Unit] DefaultDependencies=no Before=zfs-import-scan.service Before=zfs-import-cache.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/zpool import -N -o cachefile=none bpool [Install] WantedBy=zfs-import.target systemctl enable zfs-import-bpool.service */ }