From 5a8a30e0533218d2db74859e6b1d44f76661757b Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jan 2025 10:31:55 +0000 Subject: [PATCH] add earlyoom to citadel and reduce swap --- hosts/citadel/default.nix | 7 ++++++- hosts/semita/default.nix | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hosts/citadel/default.nix b/hosts/citadel/default.nix index 83ccdae..944e5eb 100644 --- a/hosts/citadel/default.nix +++ b/hosts/citadel/default.nix @@ -80,7 +80,7 @@ in { swapDevices = [ { device = "/.swapvol/swapfile"; - size = 32 * 1024; + size = 4 * 1024; } ]; @@ -99,6 +99,11 @@ in { # ${pkgs.xorg.xmodmap}/bin/xmodmap -e "keycode 46 = l L Right L" # ''; }; + # enable oom killer when system ram drops below 5% free + earlyoom = { + enable = true; + freeMemThreshold = 5; # <%5 free + }; }; # fix cpu throttling on Lenovo Thinkpad diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 04734d1..1b0af6d 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -108,7 +108,7 @@ in { swapDevices = [ { device = "/.swapvol/swapfile"; - size = 32 * 1024; + size = 4 * 1024; } ];