How to configure zram so the changes are persistent between sessions

HI,

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

[zram0]
compression-algorithm=zstd
swap-priority=5
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

Podd-opps

https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=zram

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