Files
config/profiles/earlyoom.nix
2025-06-05 16:22:48 +02:00

17 lines
512 B
Nix

{
services.earlyoom = {
enable = true;
# all must be true for earlyoom to kill shit
freeMemThreshold = 2; # in percent
freeSwapThreshold = 20; # in percent
freeSwapKillThreshold = 5; # in percent, sigkill
extraArgs = [
# "-g" # Kill all processes that have same process group id
"--avoid"
"^(X|init|Xorg|ssh|plasma.*|gnome.*|konsole|lxterminal|ghostty|kwin)$"
"--prefer"
"^(electron|libreoffice|gimp|zen*|nix-env|nix-instantiate|gcc|rustc)$"
];
};
}