Configure EarlyOOM

This commit is contained in:
Agatha Lovelace 2024-11-22 17:26:56 +01:00
parent b30f9a4f46
commit d1d94f9c24
Signed by: sorceress
GPG Key ID: 01D0B3AB10CED4F8
1 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,4 @@
{ config, ... }:
{
imports = [ ./users ];
@ -50,4 +51,20 @@
'';
settings.PasswordAuthentication = false;
};
services.earlyoom = {
enable = true;
freeSwapThreshold = 5;
freeMemThreshold = 5;
extraArgs = [
"-g"
"--avoid '^(sshd|systemd.*|tailscale.*|)$'"
];
};
# Fix Wireguard and Tailscale with NetworkManager
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
}