From 9f43ea887e19ae4d5ff1b37f8314a0a28c058d5b Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 22 Jan 2026 16:13:20 +0900 Subject: [PATCH] base: OOM early on nixos rebuilds --- base/nix.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/nix.nix b/base/nix.nix index dc52ff4..d5eae56 100644 --- a/base/nix.nix +++ b/base/nix.nix @@ -37,4 +37,9 @@ "unstable=${inputs.nixpkgs-unstable}" ]; }; + + # Make builds to be more likely killed than important services. + # 100 is the default for user slices and 500 is systemd-coredumpd@ + # We rather want a build to be killed than our precious user sessions as builds can be easily restarted. + systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = lib.mkDefault 250; }