diff --git a/hosts/FredOS-Mediaserver.nix b/hosts/FredOS-Mediaserver.nix index 3965ab4..f161a35 100644 --- a/hosts/FredOS-Mediaserver.nix +++ b/hosts/FredOS-Mediaserver.nix @@ -6,6 +6,18 @@ "L+ /home/fred/storage - - - - /mnt/storage" ]; + # Default max-jobs = 56 × cores = all let a from-source build thrash 31G + # into a 10h livelock, taking routing down with it. Cap parallelism and + # fence builds in a cgroup so the kernel OOM-kills a compiler, not the LAN. + nix.settings.max-jobs = 8; + nix.settings.cores = 8; + nix.daemonCPUSchedPolicy = "batch"; + systemd.services.nix-daemon.serviceConfig = { + MemoryHigh = "12G"; + MemoryMax = "16G"; + OOMPolicy = "continue"; # a killed build shouldn't stop the daemon + }; + # Basic system packages environment.systemPackages = with pkgs; [ mergerfs