summaryrefslogtreecommitdiff
path: root/system-profiles/zswap.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-12-25 19:30:17 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2025-12-25 19:30:17 +0100
commit929cfbf0d4620892e6ad1231c32c9c7b8c9265c4 (patch)
treebdd54f8db8d1bfca5157ae0b95783314f4909518 /system-profiles/zswap.nix
parentab1a8a443128ec38bf71b64c654e35f10216fd86 (diff)
downloadnixos-flakes.tar
nixos-flakes.tar.gz
nixos-flakes.tar.bz2
nixos-flakes.tar.xz
nixos-flakes.zip
Diffstat (limited to 'system-profiles/zswap.nix')
-rw-r--r--system-profiles/zswap.nix25
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}