zramSwap in NixOS enables compressed swap space in RAM using the kernel's zram module, acting as a faster, disk-free alternative to traditional swap partitions or files. It's ideal for systems with sufficient RAM and helps reduce SSD wear.
- Enable zramSwap in your configuration with:
boot.kernelModules = [ "zram" ]; zramSwap = {
enable = true;