test earlyoom
This commit is contained in:
4
base.nix
4
base.nix
@@ -73,6 +73,10 @@
|
||||
# enable kernel same-page merging for improved vm test performance
|
||||
hardware.ksm.enable = true;
|
||||
|
||||
# enable Alt+SysRq+<key> shortcuts
|
||||
# https://wiki.nixos.org/wiki/Linux_kernel#Enable_SysRq
|
||||
# boot.kernel.sysctl."kernel.sysrq" = 1;
|
||||
|
||||
boot.initrd.systemd.enable = true; # systemd manages initfs boot, systemd-analyse can see what happened
|
||||
# https://discourse.nixos.org/t/what-to-do-with-a-full-boot-partition/2049
|
||||
# raise to 15 if auto upgrading
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../../profiles/sshd
|
||||
../../../profiles/earlyoom.nix
|
||||
../../../profiles/no-suspend.nix
|
||||
#../../../profiles/oci/podman.nix
|
||||
../../../profiles/oci/docker.nix
|
||||
|
||||
16
profiles/earlyoom.nix
Normal file
16
profiles/earlyoom.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
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)$"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user