Skip to content

preferLocalBuild should not override max-jobs=0 #3810

@grahamc

Description

@grahamc

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:

  1. extend the nix.conf to accept a mandatory-features option
  2. treat derivations where preferLocalBuild == true as if they had the "local-preferred" feature
  3. add local-preferred to the default value of system-features

Backwards Compatibility

  • The current behavior of max-jobs=0 can be achieved by setting mandatory-features = local-preferred and max-jobs=auto.
  • Other users may want to set max-jobs=0 and assign the local-preferred feature to a specific builder which is nearby.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions