flake/nixos/profiles/common/opt-in/zram-generator.nix
2024-01-16 10:02:44 +08:00

17 lines
378 B
Nix

{
services.zram-generator = {
enable = true;
settings.zram0 = {
compression-algorithm = "zstd";
zram-size = "ram";
};
};
# https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram
boot.kernel.sysctl = {
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
"vm.page-cluster" = 0;
};
}