Mediaserver: cap nix build parallelism and memory

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-09-27 08:21:32 +01:00
parent 2509d2f498
commit d2a4e5cebe

View file

@ -6,6 +6,18 @@
"L+ /home/fred/storage - - - - /mnt/storage" "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 # Basic system packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
mergerfs mergerfs