-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is your feature request related to a problem? Please describe.
The documented behavior of max-jobs defines that even with a value of 0, builds with preferLocalBuild = true still build locally. This is a fairly major policy decision that the daemon makes on behalf of the user, and is a decision the user cannot easily override.
Sometimes a machine should perform absolutely no builds, in which case their options to fully disabling builds is to either delete all the build users (not sure nix-daemon would be happy with this) or set the system to a bogus value and assume/hope nobody will use it.
Describe the solution you'd like
I propose we extend the features feature of remote building to local building, too, and use preferLocalBuild as a listed feature.
Concretely, I want to:
- extend the
nix.confto accept amandatory-featuresoption - treat derivations where
preferLocalBuild == trueas if they had the "local-preferred" feature - add
local-preferredto the default value ofsystem-features
Backwards Compatibility
- The current behavior of
max-jobs=0can be achieved by settingmandatory-features = local-preferredandmax-jobs=auto. - Other users may want to set
max-jobs=0and assign thelocal-preferredfeature to a specific builder which is nearby.