Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/nix-daemon: Organize buildMachine options with a submodule #83104

Merged
merged 3 commits into from
Jul 5, 2020

Conversation

Valodim
Copy link
Contributor

@Valodim Valodim commented Mar 21, 2020

This PR picks up #47636. It changes the nix.buildMachine option from an attribute set to a submodule, with documentations and examples per option.

A couple of thoughts:

  1. The sshKey option is a secret path, which there is no good solution for so far. See Add types.secretPath #78640
  2. There's no assertion to check for presence of both system and systems at the same time, because I couldn't figure out how to do assertions per module nicely :) I guess it's an artifact anyways that there are even two options for this, I'd rather deprecate systems, and type system as str or listOf str, expecting the former to cover basically all cases.
  3. As per this suggestion, I put the features variables an enum, and added an "extra" option that allows freeform features. The idea is to have a somewhat curated list of commonly used names where typos can't happen, and move special ones to their own option.

Ttested this locally, works as expected :)

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 21, 2020
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Mar 21, 2020
@Valodim Valodim force-pushed the distbuild-module branch 2 times, most recently from 502377a to 5093da7 Compare March 22, 2020 10:05
@Valodim
Copy link
Contributor Author

Valodim commented Mar 27, 2020

@msteen thanks for the review :) fixed all your points.

I also changed system and systems to default to builtins.currentSystem if neither are set, that seems to be a reasonable default.

@Valodim Valodim requested a review from msteen March 27, 2020 21:31
Copy link
Contributor

@msteen msteen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me now!

@infinisil infinisil self-requested a review April 14, 2020 12:34
@Ericson2314
Copy link
Member

@Valodim thanks for picking this up for me! And @infinisil, thanks for letting me know.

@Ericson2314
Copy link
Member

Can you add a 20.09 change log breaking change notice?

@Valodim Valodim force-pushed the distbuild-module branch from 28a4c47 to 261c556 Compare July 5, 2020 14:28
@Valodim
Copy link
Contributor Author

Valodim commented Jul 5, 2020

I updated this to incorporate all feedback (and rebased on master).

I think we actually ended up compatible with (sane usage of) the previous definitions, at least the config implementation looks identical modulo handling of defaults to me, and the example from the previous documentation produces identical results.

There is a slight potential for errors in configs that used sloppy types before, e.g. a string value for maxJobs will lead to an error like this:

error: The option value 'nix.buildMachines.[definition 1-entry 1].maxJobs' in ... is not of type 'signed integer'.
I added an item to the release notes about that.

@ofborg ofborg bot added 8.has: changelog 8.has: documentation This PR adds or changes documentation 2.status: merge conflict This PR has merge conflicts with the target branch labels Jul 5, 2020
@Valodim Valodim force-pushed the distbuild-module branch from 7dff142 to 6d52e2e Compare July 5, 2020 14:54
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 5, 2020
@Valodim Valodim requested a review from Ericson2314 July 5, 2020 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants