diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-12-25 19:30:17 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-12-25 19:30:17 +0100 |
| commit | 929cfbf0d4620892e6ad1231c32c9c7b8c9265c4 (patch) | |
| tree | bdd54f8db8d1bfca5157ae0b95783314f4909518 /system-profiles/zswap.nix | |
| parent | ab1a8a443128ec38bf71b64c654e35f10216fd86 (diff) | |
| download | nixos-flakes.tar nixos-flakes.tar.gz nixos-flakes.tar.bz2 nixos-flakes.tar.xz nixos-flakes.zip | |
...flakes
Diffstat (limited to 'system-profiles/zswap.nix')
| -rw-r--r-- | system-profiles/zswap.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/system-profiles/zswap.nix b/system-profiles/zswap.nix new file mode 100644 index 00000000..ac141f55 --- /dev/null +++ b/system-profiles/zswap.nix | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | { ... }: | ||
| 2 | |||
| 3 | { | ||
| 4 | config = { | ||
| 5 | boot.kernelParams = [ | ||
| 6 | "zswap.enabled=1" | ||
| 7 | "zswap.compressor=zstd" | ||
| 8 | "zswap.zpool=zsmalloc" | ||
| 9 | "zswap.max_pool_percent=25" | ||
| 10 | "zswap.accept_threshold_percent=90" | ||
| 11 | "zswap.shrinker_enabled=1" | ||
| 12 | ]; | ||
| 13 | |||
| 14 | boot.initrd.kernelModules = [ "zstd" "zsmalloc" ]; | ||
| 15 | |||
| 16 | boot.kernel.sysfs.module.zswap.parameters = { | ||
| 17 | enabled = true; | ||
| 18 | compressor = "zstd"; | ||
| 19 | zpool = "zsmalloc"; | ||
| 20 | max_pool_percent = 25; | ||
| 21 | accept_threshold_percent = 90; | ||
| 22 | shrinker_enabled = true; | ||
| 23 | }; | ||
| 24 | }; | ||
| 25 | } | ||
