diff options
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/aszlig/profiles/workstation/default.nix | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/user/aszlig/profiles/workstation/default.nix b/modules/user/aszlig/profiles/workstation/default.nix index f0eb4501..c425d750 100644 --- a/modules/user/aszlig/profiles/workstation/default.nix +++ b/modules/user/aszlig/profiles/workstation/default.nix @@ -4,6 +4,9 @@ let cfg = config.vuizvui.user.aszlig.profiles.workstation; inherit (config.services.xserver) xrandrHeads; + kernelVersion = config.boot.kernelPackages.kernel.version; + hasZstd = lib.versionAtLeast kernelVersion "4.18"; + in { options.vuizvui.user.aszlig.profiles.workstation = { enable = lib.mkEnableOption "Workstation profile for aszlig"; @@ -12,7 +15,23 @@ in { config = lib.mkIf cfg.enable { vuizvui.user.aszlig.profiles.base.enable = true; - boot.kernelParams = [ "zswap.enabled=1" "panic=1800" ]; + boot.kernelPatches = lib.singleton { + name = "zswap-config"; + patch = null; + extraConfig = '' + CRYPTO_${if hasZstd then "ZSTD" else "LZO"} y + ZSWAP y + Z3FOLD y + ''; + }; + + boot.kernelParams = [ + "zswap.enabled=1" + "zswap.zpool=z3fold" + "zswap.compressor=${if hasZstd then "zstd" else "lzo"}" + "panic=1800" + ]; + boot.cleanTmpDir = true; environment.systemPackages = with lib; let |