Skip to content

Instantly share code, notes, and snippets.

@jamesog
Created September 7, 2024 15:52
Show Gist options
  • Save jamesog/c68f6aa2df2c0fbc14cea6c5c2157c00 to your computer and use it in GitHub Desktop.
Save jamesog/c68f6aa2df2c0fbc14cea6c5c2157c00 to your computer and use it in GitHub Desktop.
NixOS on ZFS root (UTM / virtio)
{
networking.hostId = "..."; # Use head -c8 /etc/machine-id to get this
services.zfs.autoScrub.enable = true;
}
{
boot.initrd.kernelModules = [ "zfs" ];
boot.zfs.devNodes = "/dev"; # IMPORTANT: On UTM / virtio the disk doesn't show in /dev/disk/by-id and the system won't boot
# fileSystems as added by nixos-generate-config
swapDevices = [ { device = "/dev/zvol/rpool/swap"; } ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment