Sorry for resurrecting this old thread, but I think this information will be valuable for others coming here just like me.
I’m using NixOS on desktop and, while it was doing some automated system upgrade today, my desktop got a bit frozen. So, I got here. The solution was for NixOS 20.09, quite old now.
Quoting from NixOS 21.11 release notes:
nix.daemonNiceLevel
andnix.daemonIONiceLevel
have been removed in favour of the new optionsnix.daemonCPUSchedPolicy
,nix.daemonIOSchedClass
andnix.daemonIOSchedPriority
. Please refer to the options documentation and thesched(7)
andioprio_set(2)
man pages for guidance on how to use them.
So, for more modern NixOS desktop usage, this module should make it snappier:
{
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
}
Please read the options’ docs for details. I haven’t tested it intensively yet, FWIW.