From 5339721b50d549b3f05dee047d14a8be258572fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 20 Sep 2026 14:58:59 +0200 Subject: [PATCH 1/3] throttle nix daemon on high mem --- nixosConfigurations/muede-lpt2/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 59a3eef..492afcd 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -29,6 +29,13 @@ "i686-linux" ]; + # Global default (nixosModules/distributed-builds.nix) is MemoryMax=90%, + # which isn't tight enough on this machine's 31GiB to avoid OOM. + systemd.services.nix-daemon.serviceConfig = { + MemoryHigh = "60%"; + MemoryMax = lib.mkForce "80%"; + }; + services.xserver.xkb = { # Configure keymap in X11 layout = "de"; From 9fe9f1201458eb5ef4de76c26af311ed9714c665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 20 Sep 2026 15:00:03 +0200 Subject: [PATCH 2/3] longer timeout for container stops --- nixosConfigurations/muede-lpt2/containers.nix | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/nixosConfigurations/muede-lpt2/containers.nix b/nixosConfigurations/muede-lpt2/containers.nix index ff0e4d5..8e4ae9f 100644 --- a/nixosConfigurations/muede-lpt2/containers.nix +++ b/nixosConfigurations/muede-lpt2/containers.nix @@ -1,4 +1,9 @@ -{ self, ... }: +{ + config, + lib, + ... +}: + { config = { boot.enableContainers = true; @@ -22,13 +27,25 @@ # }; # }; - # # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn - # # before it finishes halting, leaving cgroups busy and breaking restarts. - # systemd.services."container@damocles".serviceConfig = { - # TimeoutStopSec = "60s"; - # # After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups. - # # Without this, the immediate restart attempt fails with "Device or resource busy". - # RestartSec = "5s"; - # }; + # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn + # before it finishes halting, leaving cgroups busy and breaking restarts. + systemd.services = + let + # The imperative template plus every declarative container: nixos-containers + # generates each one as its own unit, so an override on "container@" alone + # would not reach them. + containerUnits = [ + "container@" + ] + ++ map (name: "container@${name}") (lib.attrNames config.containers); + in + lib.genAttrs containerUnits (_: { + serviceConfig = { + TimeoutStopSec = "2min"; + # After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups. + # Without this, the immediate restart attempt fails with "Device or resource busy". + RestartSec = "5s"; + }; + }); }; } From 5bae4840e7fa842a3e0ad5bdd1ab94fca1f74021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 20 Sep 2026 15:00:27 +0200 Subject: [PATCH 3/3] nix fmt ci yml --- .forgejo/workflows/build.yaml | 2 +- .forgejo/workflows/flake-update.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 73c0056..5282fda 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -3,7 +3,7 @@ name: build on: pull_request: {} push: - branches: [ main ] + branches: [main] jobs: build: diff --git a/.forgejo/workflows/flake-update.yaml b/.forgejo/workflows/flake-update.yaml index f4f403d..0e8520b 100644 --- a/.forgejo/workflows/flake-update.yaml +++ b/.forgejo/workflows/flake-update.yaml @@ -2,11 +2,11 @@ name: flake update on: schedule: - - cron: '0 3 * * *' + - cron: "0 3 * * *" workflow_dispatch: inputs: target: - description: 'Inputs to update' + description: "Inputs to update" type: choice default: all options: