rydiwo: restore /swapfile as swapDevices, cap nixos-prebuild at 6G
nixos flake checks / invariant-checks (push) Failing after 7s
test-runner / smoke (push) Successful in 1s

Measured on rydiwo 2026-11-11: a 6 GiB /swapfile exists and is active,
but only because someone ran `swapon` by hand -- there is no swapDevices
anywhere in the config and no swap line in the generated /etc/fstab, so a
reboot silently loses swap. Declared here as swapDevices (device
/swapfile, size 6144), host scope only.

nixos-prebuild.service (daily 04:00 nix build of the whole toplevel, Nice
10, CPUQuota 20%, defined in modules/essentials/systemd-routines.nix) had
no memory bound and is what got OOM-killed on this 11 GiB box. The 6G
MemoryMax is set here, per host, not in the shared module.

No nixos-rebuild was run (owner switches separately).
This commit is contained in:
oqyude committed 2026-11-11 20:22:11 +03:00
1 parent da8fbaf008
commit ae9c6502a2
1 file changed
+19
+19
View File
@@ -79,6 +79,25 @@
system.stateVersion = "26.05";
# Measured 2026-11-11: a 6 GiB /swapfile exists and is active, but only
# because somebody ran `swapon` by hand — there is no swapDevices in the
# config and no swap line in the generated /etc/fstab, so a reboot loses
# swap. On this 11 GiB box (it runs qemu VMs) that turned a build into an
# OOM kill.
swapDevices = [
{
device = "/swapfile";
size = 6144;
}
];
# Measured 2026-11-11: nixos-prebuild.service (daily 04:00 nix build of the
# whole toplevel, Nice 10, CPUQuota 20% — defined in
# modules/essentials/systemd-routines.nix, shared by every host, so no cap
# there) had no memory bound and was what got killed when memory ran out.
# Host-scoped bound: 6 GiB of the 11 GiB box stays for engipy/the VMs.
systemd.services.nixos-prebuild.serviceConfig.MemoryMax = "6G";
# --------------------------------------------------------------------------
# PXE infrastructure rig (L2 of docs/ARCHITECTURE.md).
# The rig gives rydiwo an isolated Linux bridge