How to Install and enable Zram

Hi I`d like to know how to correct install and enable zram in nix os, I tried in /etc/nixos/configuration.nix but give error on nixos-rebuild

It’s much easier to help you if you can share your config and the error message.

1 Like

Just one line:
zramSwap.enable = true;

And the error message?

The more information you can provide, the easier this is.

1 Like

Thanks, I have to enable in etc/nix/configuration file?

Thanks

I really would like to help you out, but unless you share some details of what you tried, the configuration as well as an error message, I’m afraid I will not be able to.

Yes, you have to enable zram swap in the system configuration.

And the option zramSwap.enable appears to be exactly what you need.

So to help us helping you, you need to get a bit into the details.

What exactly did you add, where did you add it and what is the error message on build?