Swap, ZRAM, Zswap and Hibernate on NixOS

I pulled this out of my non-obvious nixos config piece into its own post.

Oh no, I'm going to talk about swap, zram, zswap...

Whether to use swap is a perennial fight online. The conversation is often muddled when people conflate recommendations for servers with recommendations for workstations. In my case, I'm going to focus on desktops and laptops.

I use swap because I like suspend-then-hibernate, or "Standby, then hibernate" in the KDE settings: ![[Pasted image 20260917120542.png]]

This will first ACPI S3 suspend to RAM, then after a delay go into S4 Hibernate. I think this strikes a nice balance: if I step away for a bit I don't have to wait for things to start up, but I don't have to worry if I forget to fully power off my machine.