I remember when setting up ZFS on NixOS it was suggested not to use ZFS for swap due to the possibility of deadlocks.
What are the actual risks of it? Is it an edge-case scenario or would deadlocks be common? Is there work being done to address it upstream?
Due to the warnings and because I use both ZFS for larger pools of data as well as ZFS on root, I have never enabled the swap (which would be nice to have).
i never put swap on anything but raw hdd partitions , never of ‘fancy’ storage like XFS/ZFS etc etc. One day we will have a 1TB of ram, so will never need swap again.
I’ve had similar experiences with robotnix to build Android which has about 60 GB source tree. Make sure that /tmp is not a tmpfs which is mounted into RAM (on NixOS that is boot.tmpOnTmpfs = false). Alternatively you could do TMPDIR=/somewhere/not/in/ram nix-build ...