summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-install.sh
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-12-29 21:29:34 +0000
committerAlyssa Ross <hi@alyssa.is>2019-12-29 21:29:34 +0000
commit1acfa8ff79fd8895ebc7ca9954830ace0577fff2 (patch)
tree25f168400b9192ca94a7bdb0bb19ce11f03db509 /nixos/modules/installer/tools/nixos-install.sh
parent82bd3b0cbfb0af1555ed5b6b6f4edf2b6b17a144 (diff)
parentbe90b35b9efbd7baaa80f367ffc41609531a8fe2 (diff)
downloadnixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar.gz
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar.bz2
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar.lz
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar.xz
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.tar.zst
nixpkgs-1acfa8ff79fd8895ebc7ca9954830ace0577fff2.zip
Merge remote-tracking branch 'nixpkgs/master' into spectrum
Diffstat (limited to 'nixos/modules/installer/tools/nixos-install.sh')
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index 8685cb345e1..a3ff3fe2c0c 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -14,6 +14,8 @@ extraBuildFlags=()
 mountPoint=/mnt
 channelPath=
 system=
+verbosity=()
+buildLogs=
 
 while [ "$#" -gt 0 ]; do
     i="$1"; shift 1
@@ -55,6 +57,12 @@ while [ "$#" -gt 0 ]; do
         --debug)
             set -x
             ;;
+        -v*|--verbose)
+            verbosity+=("$i")
+            ;;
+        -L|--print-build-logs)
+            buildLogs="$i"
+            ;;
         *)
             echo "$0: unknown option \`$i'"
             exit 1
@@ -94,7 +102,7 @@ if [[ -z $system ]]; then
     outLink="$tmpdir/system"
     nix build --out-link "$outLink" --store "$mountPoint" "${extraBuildFlags[@]}" \
         --extra-substituters "$sub" \
-        -f '<nixpkgs/nixos>' system -I "nixos-config=$NIXOS_CONFIG"
+        -f '<nixpkgs/nixos>' system -I "nixos-config=$NIXOS_CONFIG" ${verbosity[@]} ${buildLogs}
     system=$(readlink -f $outLink)
 fi
 
@@ -103,7 +111,7 @@ fi
 # a progress bar.
 nix-env --store "$mountPoint" "${extraBuildFlags[@]}" \
         --extra-substituters "$sub" \
-        -p $mountPoint/nix/var/nix/profiles/system --set "$system"
+        -p $mountPoint/nix/var/nix/profiles/system --set "$system" ${verbosity[@]}
 
 # Copy the NixOS/Nixpkgs sources to the target as the initial contents
 # of the NixOS channel.
@@ -115,7 +123,8 @@ if [[ -z $noChannelCopy ]]; then
         echo "copying channel..."
         mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root
         nix-env --store "$mountPoint" "${extraBuildFlags[@]}" --extra-substituters "$sub" \
-                -p $mountPoint/nix/var/nix/profiles/per-user/root/channels --set "$channelPath" --quiet
+                -p $mountPoint/nix/var/nix/profiles/per-user/root/channels --set "$channelPath" --quiet \
+                ${verbosity[@]}
         install -m 0700 -d $mountPoint/root/.nix-defexpr
         ln -sfn /nix/var/nix/profiles/per-user/root/channels $mountPoint/root/.nix-defexpr/channels
     fi