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-rebuild: allow to override builders #53801

Merged
merged 3 commits into from Jan 13, 2019
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Jan 11, 2019

Since nix 2.0 the no-build-hook option was replaced by the builders options
that allows to override remote builders ad-hoc.
Since it is useful to disable remote builders updating nixos without network,
this commit reintroduces the option.

Motivation for this change
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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mic92 Mic92 requested a review from grahamc January 11, 2019 11:10
@Mic92 Mic92 requested a review from infinisil as a code owner January 11, 2019 11:10
root) to be configured as trusted user in nix daemon. This can be
achived by using the <literal>nix.trustedUsers</literal> nixos option.
Examples values for that option are described in the
<literal>Remote builds chapter<literal> in the Nix manual,
Copy link
Member Author

Choose a reason for hiding this comment

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

@grahamc can you help me out with converting this to a cross-reference here?

Allow to specify remote builders ad-hoc for building the new system.
This requires user executing <command>nixos-rebuild</command> (usually
root) to be configured as trusted user in nix daemon. This can be
achived by using the <literal>nix.trustedUsers</literal> nixos option.
Copy link
Member Author

Choose a reason for hiding this comment

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

nixos options probably also have a special markup?

Copy link
Member

Choose a reason for hiding this comment

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

as trusted user in nix daemon -> as a trusted user in the Nix daemon.

nixos option -> NixOS option.

j="$1"; shift 1
extraBuildFlags+=("$i" "$j")
;;
--show-trace|--no-build-hook|--keep-failed|-K|--keep-going|-k|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|--repair|--no-build-output|-Q|-j*)
Copy link
Member Author

Choose a reason for hiding this comment

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

--no-build-hook is no longer accepted since nix 2.0.

@Mic92
Copy link
Member Author

Mic92 commented Jan 11, 2019

There was also an issue related to that. @vcuncat do you remember which one this was?
Update it was this one: NixOS/nix#1118

<listitem>
<para>
Allow to specify remote builders ad-hoc for building the new system.
This requires user executing <command>nixos-rebuild</command> (usually
Copy link
Member

Choose a reason for hiding this comment

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

user -> the user.

Since nix 2.0 the no-build-hook option was replaced by the builders options
that allows to override remote builders ad-hoc.
Since it is useful to disable remote builders updating nixos without network,
this commit reintroduces the option.
nixos/doc/manual/man-nixos-rebuild.xml Outdated Show resolved Hide resolved
nixos/doc/manual/man-nixos-rebuild.xml Outdated Show resolved Hide resolved
FRidh and others added 2 commits January 12, 2019 18:25
Co-Authored-By: Mic92 <Mic92@users.noreply.github.com>
Co-Authored-By: Mic92 <Mic92@users.noreply.github.com>
@dtzWill
Copy link
Member

dtzWill commented Jan 13, 2019

--option builders "" already works, FWIW? Does this add support for the more direct --builders ""?

@LnL7
Copy link
Member

LnL7 commented Jan 13, 2019

Ah indeed, that explains my confusion.

@Mic92
Copy link
Member Author

Mic92 commented Jan 13, 2019

@dtzWill yes, plus some documentation, which does not hurt, especially that root is not in the trusted user group by default.

@Mic92 Mic92 merged commit bfbadab into NixOS:master Jan 13, 2019
@Mic92 Mic92 deleted the nixos-builders branch January 13, 2019 21:59
@dtzWill
Copy link
Member

dtzWill commented Jan 13, 2019

Yes indeed, thank you! \o/

@vcunat
Copy link
Member

vcunat commented Jan 13, 2019

This merge broke the build of NixOS manual: https://hydra.nixos.org/build/87335696

@vcunat
Copy link
Member

vcunat commented Jan 13, 2019

Ah, just a trivial typo. I fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants