From 7e03c148e44a6b45f365515cb0b809b03451f34d Mon Sep 17 00:00:00 2001 From: Glen Goodwin Date: Wed, 6 Dec 2023 12:53:02 -0500 Subject: [PATCH] feat: add earlyoom Dont really need this but its cool --- hosts/candlekeep/configuration.nix | 1 + hosts/candlekeep/earlyoom.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 hosts/candlekeep/earlyoom.nix diff --git a/hosts/candlekeep/configuration.nix b/hosts/candlekeep/configuration.nix index 1fff8b2..abc8dc4 100644 --- a/hosts/candlekeep/configuration.nix +++ b/hosts/candlekeep/configuration.nix @@ -27,6 +27,7 @@ ./auditd.nix ./kernel.nix ./sysctl.nix + ./earlyoom.nix # Or modules from other flakes (such as nixos-hardware): # inputs.hardware.nixosModules.common-cpu-amd diff --git a/hosts/candlekeep/earlyoom.nix b/hosts/candlekeep/earlyoom.nix new file mode 100644 index 0000000..308ff7a --- /dev/null +++ b/hosts/candlekeep/earlyoom.nix @@ -0,0 +1,11 @@ +{ + services.earlyoom = { + enable = true; + freeSwapThreshold = 2; + freeMemThreshold = 2; + extraArgs = [ + "-g" "--avoid '^(.Hyrpland-wrapp|alacritty|zerotier-one|.waybar-wrapped)$'" + "--prefer '^(electron|libreoffice|gimp|Isolated Web Co)$'" + ]; + }; +}