From e40bfa4d850ed5973bdfd965fc331feb545a5e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 11 Jan 2019 10:39:26 +0000 Subject: [PATCH 1/3] 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. --- nixos/doc/manual/man-nixos-rebuild.xml | 53 ++++++++++++++----- .../modules/installer/tools/nixos-rebuild.sh | 4 +- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/nixos/doc/manual/man-nixos-rebuild.xml b/nixos/doc/manual/man-nixos-rebuild.xml index 551a65f5e96b..5e66946aa5be 100644 --- a/nixos/doc/manual/man-nixos-rebuild.xml +++ b/nixos/doc/manual/man-nixos-rebuild.xml @@ -13,35 +13,35 @@ - nixos-rebuild + nixos-rebuild - + - + - + - + - + - + - + @@ -50,29 +50,33 @@ - + - + - + - + + + + builder-spec + - + - + @@ -315,6 +319,27 @@ $ ./result/bin/run-*-vm + + + + builder-spec + + + + Allow to specify remote builders ad-hoc for building the new system. + This requires the user executing nixos-rebuild (usually + root) to be configured as a trusted user in the Nix daemon. This can be + achived by using the nix.trustedUsers NixOS option. + Examples values for that option are described in the + Remote builds chapter in the Nix manual, + (i.e. --builders "ssh://bigbrother x86_64-linux"). + By specifying an empty string existing builders specified in + /etc/nix/machines can be ignored: + --builders "" for example when they are not + reachable due to network connectivity. + + + diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 2af73519bc52..361c2e49e05c 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -53,11 +53,11 @@ while [ "$#" -gt 0 ]; do repair=1 extraBuildFlags+=("$i") ;; - --max-jobs|-j|--cores|-I) + --max-jobs|-j|--cores|-I|--builders) 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*) + --show-trace|--keep-failed|-K|--keep-going|-k|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|--repair|--no-build-output|-Q|-j*) extraBuildFlags+=("$i") ;; --option) From f45195fb443666c1bc347dbe3559636f92b81f2e Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 12 Jan 2019 18:25:52 +0000 Subject: [PATCH 2/3] Update nixos/doc/manual/man-nixos-rebuild.xml Co-Authored-By: Mic92 --- nixos/doc/manual/man-nixos-rebuild.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/doc/manual/man-nixos-rebuild.xml b/nixos/doc/manual/man-nixos-rebuild.xml index 5e66946aa5be..68d3233606f6 100644 --- a/nixos/doc/manual/man-nixos-rebuild.xml +++ b/nixos/doc/manual/man-nixos-rebuild.xml @@ -326,7 +326,7 @@ $ ./result/bin/run-*-vm - Allow to specify remote builders ad-hoc for building the new system. + Allow ad-hoc remote builders for building the new system. This requires the user executing nixos-rebuild (usually root) to be configured as a trusted user in the Nix daemon. This can be achived by using the nix.trustedUsers NixOS option. From 9f827d66f58267df8d8f15b5bfc162b6ec33ab32 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 12 Jan 2019 18:26:00 +0000 Subject: [PATCH 3/3] Update nixos/doc/manual/man-nixos-rebuild.xml Co-Authored-By: Mic92 --- nixos/doc/manual/man-nixos-rebuild.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/doc/manual/man-nixos-rebuild.xml b/nixos/doc/manual/man-nixos-rebuild.xml index 68d3233606f6..7b964280d6a6 100644 --- a/nixos/doc/manual/man-nixos-rebuild.xml +++ b/nixos/doc/manual/man-nixos-rebuild.xml @@ -329,7 +329,7 @@ $ ./result/bin/run-*-vm Allow ad-hoc remote builders for building the new system. This requires the user executing nixos-rebuild (usually root) to be configured as a trusted user in the Nix daemon. This can be - achived by using the nix.trustedUsers NixOS option. + achieved by using the nix.trustedUsers NixOS option. Examples values for that option are described in the Remote builds chapter in the Nix manual, (i.e. --builders "ssh://bigbrother x86_64-linux").