From 929cfbf0d4620892e6ad1231c32c9c7b8c9265c4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 25 Dec 2025 19:30:17 +0100 Subject: ... --- system-profiles/zswap.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 system-profiles/zswap.nix (limited to 'system-profiles/zswap.nix') 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 @@ +{ ... }: + +{ + config = { + boot.kernelParams = [ + "zswap.enabled=1" + "zswap.compressor=zstd" + "zswap.zpool=zsmalloc" + "zswap.max_pool_percent=25" + "zswap.accept_threshold_percent=90" + "zswap.shrinker_enabled=1" + ]; + + boot.initrd.kernelModules = [ "zstd" "zsmalloc" ]; + + boot.kernel.sysfs.module.zswap.parameters = { + enabled = true; + compressor = "zstd"; + zpool = "zsmalloc"; + max_pool_percent = 25; + accept_threshold_percent = 90; + shrinker_enabled = true; + }; + }; +} -- cgit v1.2.3