From 23fee8bfbddd8ce4c0a38ff4cbdd3cc9481232bd Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 11 Feb 2017 14:18:17 +0200 Subject: [PATCH 1/2] nixos-rebuild: Support passing e.g. '-j8' Where there is no space between '-j' and the number. --- nixos/modules/installer/tools/nixos-rebuild.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 8e55a4f525f9..846f79d77f4d 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -52,13 +52,13 @@ while [ "$#" -gt 0 ]; do repair=1 extraBuildFlags+=("$i") ;; - --show-trace|--no-build-hook|--keep-failed|-K|--keep-going|-k|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|--repair|--no-build-output|-Q) - extraBuildFlags+=("$i") - ;; --max-jobs|-j|--cores|-I) 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*) + extraBuildFlags+=("$i") + ;; --option) j="$1"; shift 1 k="$1"; shift 1 From 2000f0941e5de5ce62ede09f2003ff3ccfcd26ac Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 11 Feb 2017 15:52:23 +0200 Subject: [PATCH 2/2] nixos-rebuild: Don't build nixos-rebuild with --fast --- nixos/modules/installer/tools/nixos-rebuild.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 846f79d77f4d..4f73865dad6a 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -15,6 +15,7 @@ origArgs=("$@") extraBuildFlags=() action= buildNix=1 +fast= rollback= upgrade= repair= @@ -66,6 +67,7 @@ while [ "$#" -gt 0 ]; do ;; --fast) buildNix= + fast=1 extraBuildFlags+=(--show-trace) ;; --profile-name|-p) @@ -217,7 +219,7 @@ if [ -z "$_NIXOS_REBUILD_REEXEC" ]; then fi # Re-execute nixos-rebuild from the Nixpkgs tree. -if [ -z "$_NIXOS_REBUILD_REEXEC" -a -n "$canRun" ]; then +if [ -z "$_NIXOS_REBUILD_REEXEC" -a -n "$canRun" -a -z "$fast" ]; then if p=$(nix-build --no-out-link --expr 'with import {}; config.system.build.nixos-rebuild' "${extraBuildFlags[@]}"); then export _NIXOS_REBUILD_REEXEC=1 exec $p/bin/nixos-rebuild "${origArgs[@]}"