common: cap nix-daemon CPUWeight at 50 to keep services responsive

Heavy local builds (gnupg/openldap checkPhase under a freshly-bumped
nixpkgs lock) were saturating CPU and starving AdGuard on the
mediaserver, making DNS effectively unresponsive until the build
finished or got cancelled.

Halving the daemon's CPU share leaves headroom for latency-sensitive
services without meaningfully slowing builds on an otherwise idle box.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
ediblerope 2026-04-29 11:17:51 +01:00
parent 3f2c88da94
commit 70ee0fc811

View file

@ -61,6 +61,12 @@
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Keep services responsive while heavy local builds run (gnupg/openldap
# checkPhase etc. were starving AdGuard until the binary cache catches up).
# Default CPUWeight is 100; halving the daemon's share lets latency-sensitive
# services breathe without meaningfully slowing builds on an idle box.
systemd.services.nix-daemon.serviceConfig.CPUWeight = 50;
# Use latest kernel
boot.kernelPackages = pkgs.linuxPackages_latest;