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

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

Closed

Conversation

@Ericson2314
Copy link
Member

Ericson2314 commented Oct 2, 2018

Motivation for this change

What's the best way to test this sort of thing?

nixos-option -I nixpkgs=(pwd) nix.buildMachines.foo.bar

did not work for example.

Also, is this reasonable for 18.09 or is that fact that garbage attributes will be rejected a problem?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Ericson2314 Ericson2314 requested review from edolstra, matthewbauer and dezgeg Oct 2, 2018
@grahamc
Copy link
Member

grahamc commented Oct 2, 2018

Too late for 18.09, but I like the idea.

@Ericson2314
Copy link
Member Author

Ericson2314 commented Oct 2, 2018

@grahamc my other idea was to check if types.either types.attrs (types.submodule ..) would work to provide documentation but make no errors.

default = "-";
description = ''
The path to the SSH private key with which to authenticate with
the build machine. <literal>"-"</literal> indicates falling back

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

Probably should either drop the " or at least move the quote out of the literal element.

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 Dec 5, 2018

Author Member

I think I mean the quote to be there to show the Nix literal one would write, rather than string literal, leaving it to the literal to figure out that - only makes sense as a string.

default = 1;
description = ''
Something at indicates how fast the machine is relative to an
arbitrary norm???

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

An arbitrary integer to indicate the build performance of this system relative to the other buildMachines.

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

... higher|lower is faster.

This comment has been minimized.

Copy link
@teto

teto Oct 2, 2018

Contributor

might be best to use unsigned/ints.between 0 100/positive as type.

decriptions = ''
A list of features derivations built with this remote may choose
to use or not. (See the documentation on Nix itself for what
those features are.)

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

What do you mean by the above parentheticals?

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 Oct 2, 2018

Author Member

I was hoping somewhere else might actually list valid features, but https://nixos.org/nix/manual/#chap-distributed-builds again just says they exist, other than the "kvm" example.

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

Ah, there is no list of valid features. You can make them up. I have a machine with the feature "big-mistake-this-ones-impure".

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 Oct 2, 2018

Author Member

oh haha

This comment has been minimized.

Copy link
@teto

teto Oct 2, 2018

Contributor

a grep on nixpkgs gives "big-parallel"/"kvm"/"benchmark"/"nixos-test". Even if it stays freefrom, it would be nice to list the default ones with a types.either( enum [ "kvm" ... ] or string).

hostName = mkOption {
type = types.string;
description = ''
The hostname of the build machine.

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

Maybe note this hostname has to resolve.

This comment has been minimized.

Copy link
@teto

teto Oct 2, 2018

Contributor

what good can be hostname that doesn't resolve ?

type = types.listOf types.string;
default = [];
description = ''
The system types the build machine can execute derivations on.

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 2, 2018

Member

How about some examples on the above two?

@Ericson2314
Copy link
Member Author

Ericson2314 commented Oct 2, 2018

Thanks @grahamc, I'll fix these later tonight.

@mmahut
Copy link
Member

mmahut commented Aug 25, 2019

Are there any updates on this pull request, please?

@teto
Copy link
Contributor

teto commented Aug 26, 2019

may be ok for 19.09. I can test once the patch is fixed.

@ivan
Copy link
Member

ivan commented Sep 6, 2019

For the author, reviewers, and committers: this PR was scanned and appears to add a use of the deprecated types.string, which emits a warning as of #66346. Before merging, please change this to another type, possibly:

  • types.str for a single string where merging does not make sense, or cannot work
  • types.lines for multi-line configuration or scripts where merging is possible
  • types.listOf types.str for a mergeable list of strings
};
sshKey = mkOption {
type = types.string;
default = "-";

This comment has been minimized.

Copy link
@Infinisil

Infinisil Sep 30, 2019

Member

Because of #69900, it would be a good idea to force this option to not have a value from the store. This can be done with an apply = toString

This comment has been minimized.

Copy link
@Infinisil

Infinisil Mar 21, 2020

Member

This isn't enough to guarantee this at all actually. See #78640 for a better way in the future. For now this should be just types.str

'';
};
system = mkOption {
type = types.string;

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer May 13, 2020

Member

should use "nullOr"

@Infinisil
Copy link
Member

Infinisil commented May 13, 2020

#83104 is an updated version of this, closing

@Infinisil Infinisil closed this May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants
You can’t perform that action at this time.