Mediaserver: cap nix build parallelism and memory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2509d2f498
commit
d2a4e5cebe
1 changed files with 12 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue