nixos/modules/services/zram-swap/default.nix

26 lines
407 B
Nix
Raw Normal View History

2024-03-07 22:26:04 +01:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.az-zram-swap;
in
{
options = {
2024-03-07 22:29:03 +01:00
services.az-zram-swap.enable = lib.mkEnableOption "Enable zram swap";
2024-03-07 22:26:04 +01:00
};
config = lib.mkIf cfg.enable {
zramSwap = {
enable = true;
priority = 100;
};
# Since we have "fast" swap, we can increase swappiness
boot.kernel.sysctl = {
"vm.swappiness" = 180;
};
};
}