summaryrefslogtreecommitdiff
path: root/system-profiles/zswap.nix
diff options
context:
space:
mode:
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}