I have set some nice and IO scheduling settings on my nix-gc.service
and nix-optimise.service
and they work great. Now I also want to use such settings for the nixos-upgrade.service
but they are obviously only affecting the nixos-rebuild
command and the evaluation phase. The build phase happens in the nix daemon which lives in nix-daemon.service
and is unaffected by this.
Here is what I am currently doing:
let
low-prio = {
Nice = 19;
IOSchedulingClass = "idle";
IOSchedulingPriority = 7;
};
in
{
nix.gc.automatic = true;
nix.optimise.automatic = true;
system.autoUpgrade.enable = true;
systemd.services.nix-gc.serviceConfig = low-prio;
systemd.services.nix-optimise.serviceConfig = low-prio;
systemd.services.nixos-upgrade.serviceConfig = low-prio;
}
Is it possible to change the nicety of the build phase for a single nix command? Or is it advisable to just force the whole nix-daemon.service
to this “low-prio” settings? What adverse effects might I expect (aside from builds taking longer)?