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

Conversation

@Mic92
Copy link
Contributor

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 Jan 11, 2019

@Mic92 Mic92 requested a review from Infinisil as a code owner Jan 11, 2019

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,

This comment has been minimized.

@Mic92

Mic92 Jan 11, 2019

Contributor

@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.

This comment has been minimized.

@Mic92

Mic92 Jan 11, 2019

Contributor

nixos options probably also have a special markup?

This comment has been minimized.

@edolstra

edolstra Jan 11, 2019

Member

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*)

This comment has been minimized.

@Mic92

Mic92 Jan 11, 2019

Contributor

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

@Mic92

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

@edolstra

edolstra Jan 11, 2019

Member

user -> the user.

nixos-rebuild: allow to override builders
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.

@Mic92 Mic92 force-pushed the Mic92:nixos-builders branch from 8a90161 to e40bfa4 Jan 11, 2019

Show resolved Hide resolved nixos/doc/manual/man-nixos-rebuild.xml Outdated
Show resolved Hide resolved nixos/doc/manual/man-nixos-rebuild.xml Outdated

FRidh and others added some commits Jan 12, 2019

Update nixos/doc/manual/man-nixos-rebuild.xml
Co-Authored-By: Mic92 <Mic92@users.noreply.github.com>
Update nixos/doc/manual/man-nixos-rebuild.xml
Co-Authored-By: Mic92 <Mic92@users.noreply.github.com>
@dtzWill

This comment has been minimized.

Copy link
Contributor

dtzWill commented Jan 13, 2019

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

@LnL7

This comment has been minimized.

Copy link
Member

LnL7 commented Jan 13, 2019

Ah indeed, that explains my confusion.

@Mic92

This comment has been minimized.

Copy link
Contributor

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

10 checks passed

grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details

@Mic92 Mic92 deleted the Mic92:nixos-builders branch Jan 13, 2019

@dtzWill

This comment has been minimized.

Copy link
Contributor

dtzWill commented Jan 13, 2019

Yes indeed, thank you! \o/

@vcunat

This comment has been minimized.

Copy link
Member

vcunat commented Jan 13, 2019

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

@vcunat

This comment has been minimized.

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