modules/nixos/system: add zswap

This commit is contained in:
wo2wz 2025-10-22 15:01:53 -04:00
parent 743160d745
commit 5bca120e01
2 changed files with 32 additions and 606 deletions

View file

@ -0,0 +1,18 @@
{ config, ... }:
{
boot = {
# necessary for lz4 compressor
initrd.systemd.enable = true;
kernelParams =
# zswap needs a swapfile
assert config.swapDevices != [];
[
"zswap.enabled=1"
"zswap.compressor=lz4"
"zswap.max_pool_percent=25"
"zswap.shrinker_enabled=1"
];
};
}