I/O & CPU scheduling, jobs & cores... and performance, baby

wowie!!! :exploding_head: :exploding_head: thanks thanks!! really, a lot. but uhm, what about the other 3 options i mentioned?

nix.daemonIOSchedClass
nix.daemonCPUSchedPolicy
nix.daemonIOSchedPriority

did i get that right, when i said

or am i confusing actual compilers like glibc, gcc, etc. and nix “derivation” builders? are those two different things?

:frog:

OH! ALSO. wait wait wait, one more thing

what about nix.daemonCPUSchedPolicy’s

This policy propagates to build processes. other is the default scheduling policy for regular tasks. The batch policy is similar to other, but optimised for non-interactive tasks.

what exactly are “regular tasks” and “non-interactive tasks”? like a [Y/n] or..?

THANKS IN ADVANCE!!!

:snowflake:

EDIT: but wait! there’s more!

services.system76-scheduler.enable = true;
services.system76-scheduler.assignments = {
  nix-builds = {
    nice = 10; # from -20 (high) to 19 (low)
    class = "batch"; # "idle", "batch", "other", "rr", "fifo"
    ioClass = "idle"; # "idle", "best-effort", "realtime"
    matchers = [
      "nix-daemon"
    ];
  };
};

p.s. sorry, cant stop yapping :stuck_out_tongue:

edit2: btw nobody mentioned this?

nixpkgs.config.enableParallelBuildingByDefault

this is literally enableParallelBuilding, but for the entire system lol

edit3 (2026 feb): OOOH check this out

https://wiki.nixos.org/wiki/Distributed_build

i have NO idea why this never appeared in my search results, ffs. this is exactly what i was looking for LOL! this is still not the solution, though, cos i still have a few more questions (sorry): are there any… drawbacks (?) from compiling for/on not-original-hardware? like, for example, you download some binary for the correct architecture/platform, but then it doesnt work or its performance is unusually slow, just because it wasnt built on specifically your machine? you know what i mean? not sure if this kind of situation has a name? i guess, what im trying to say is, how to make sure that what i am about to compile will work hardware-insensitive(ly)?

should i even worry about any of this stuff orrr… i dunno, theres just so many build flags and arguments, im just curious if nixpkgs themselves are built utilising some of this… oh, wait, nvm

edit4 (a few months later): oh. so thats what that is! yeah, i knew this, pft, obviously