summaryrefslogtreecommitdiff
path: root/system-profiles/zswap.nix
blob: ac141f55fc50178dc25bae8884e0219350e675ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
    };
  };
}