modules/nixos/system: add zswap
This commit is contained in:
parent
743160d745
commit
5bca120e01
2 changed files with 32 additions and 606 deletions
18
modules/nixos/system/zswap.nix
Normal file
18
modules/nixos/system/zswap.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue