1 # Documentation: https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html
2 # Explanation: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
13 enable = lib.mkEnableOption "zswap compressed swap cache" // {
17 maxPoolPercent = lib.mkOption {
20 description = "Maximum percentage of RAM to use for the zswap pool.";
24 config = lib.mkIf cfg.enable {
28 "zswap.compressor=zstd"
29 "zswap.max_pool_percent=${toString cfg.maxPoolPercent}"
30 "zswap.shrinker_enabled=1"
31 "zswap.zpool=zsmalloc"
33 initrd.kernelModules = [