zswap
This commit is contained in:
parent
1c73349f55
commit
c0590acdba
2 changed files with 21 additions and 0 deletions
|
|
@ -93,6 +93,7 @@
|
|||
system.flatpak.enable = true;
|
||||
system.mpv.enable = true;
|
||||
system.ananicy.enable = true;
|
||||
system.zswap.enable = true;
|
||||
system.kdeconnect.enable = true;
|
||||
# editors
|
||||
editors.micro.enable = true;
|
||||
|
|
|
|||
20
modules/software/system/zswap.nix
Normal file
20
modules/software/system/zswap.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.system.zswap;
|
||||
in {
|
||||
options.modules.software.system.zswap = {
|
||||
enable = mkEnableOption "Enable zswap, a compressed RAM cache for swap pages";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelParams = [
|
||||
"zswap.enabled=1"
|
||||
"zswap.shrinker_enabled=1" # high mem: shrink zswap, mv to swap
|
||||
"zswap.max_pool_percent=20" # TODO: tune this (keep in mind shrinker is enabled)
|
||||
"zswap.compressor=zstd" # lz4 is missing for some reason
|
||||
"zswap.zpool=zsmalloc"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue