There’s a few things to be aware of, and most of this is unrelated to NixOS and applies to any distro with ZFS.
- You cannot hibernate at all when ZFS is in use. It “works” but it still has known bugs (no, it wasn’t all fixed) that will kill any imported pools. NixOS flat out disables hibernation by default when using ZFS because of this.
- Regardless of that, you still cannot store swap on ZFS. It “works” but it also still has known bugs (again, no, it wasn’t all fixed) though thankfully this will just crash your system rather than killing pools. So no swap on swapfile or on zvol. You need a separate partition if you use swap.
- Native encryption is iffy. It has a laundry list of known bugs that have been unfixed for years now. Thankfully these bugs are pretty rarely encountered, and most of them only occur when using
zfs send --raw
, and they usually just crash the system rather than causing data loss. But there’s still a small chance that native encryption will just kill a dataset, or even a dataset that you replicate to even without--raw
. Most people report no problems for long periods of time, but the bug list is long and largely unmitigated. - Finally, and this one is specific to NixOS, there’s the issue of mountpoints. This isn’t a problem, it’s just something to be aware of. The short version is that if you want to make things simple and don’t want to think about things, then you should use
mountpoint=legacy
and letnixos-generate-config
put your file systems inhardware-configuration.nix
like you would with any other file system. The long answer is that you can use non-legacy mountpoints for anything that you don’t list inhardware-configuration.nix
except that the ones needed for boot (/
,/nix
, and a couple others) do need to be inhardware-configuration.nix
with the FS optionzfsutil
. But again, if you just use legacy, you don’t even have to think about it.
All that said, I use ZFS pretty much exclusively on all my systems, even the SD card on my rpi-based router. It’s been super reliable. I even use native encryption on a couple of them (knock on wood). But I also know what I’m doing to some degree.