From deb489df4501ea7cc75e36513ed0c516feb90595 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 28 Sep 2026 12:04:35 -0500 Subject: [PATCH] feat(core): enable zram swap and earlyoom daemon with critical process protection - Enable ZRAM compressed in-RAM swap to optimize memory pressure management. - Enable `services.earlyoom` with desktop and system preservation rules (`niri`, `dms`, `systemd`, `sshd`). --- system/core.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/system/core.nix b/system/core.nix index c45a8f8..5d067e3 100644 --- a/system/core.nix +++ b/system/core.nix @@ -52,6 +52,22 @@ ]; }; + # 🧠 Memory & Swap Management + # Compressed in-RAM swap prevents synchronous page thrashing and lockups under high memory pressure. + zramSwap = { + enable = true; + }; + + # 🛡️ Early OOM Killer Daemon + # Intervenes proactively before the kernel freezes, protecting compositor and core session services. + services.earlyoom = { + enable = true; + enableNotifications = true; + extraArgs = [ + "--avoid" "^(niri|dms|systemd|sshd)$" + ]; + }; + # System-wide administrative tools environment.systemPackages = with pkgs; [ cups-pk-helper