How to configure zram so the changes are persistent between sessions


I’m running zram. I’ve initialised it in the nix config. Zram-generator.conf in nix/store reads as:

zram-size=50 / 100 * ram

I want to adjust this file but it is read only as you’d expect in NixOS. How do I adjust the nix config to alter either this file or how zram runs? I want to change swap size and swap priority.

thanks for the help


These are the relevant options you’d set in your configuration.nix.

1 Like

Thanks, I know where to look now and it works!

1 Like