summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-27 19:58:23 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-27 19:58:23 +0100
commitcc2eeef4abfaf484363d43d6bcce510f0f16dc1d (patch)
treee4fe86b08f63348ce89c9ed204ab46d8e8737b8f /nixos/modules/installer
parent8c6f9223d02c5123cbd364d6d56caca3c81416f0 (diff)
downloadnixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar.gz
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar.bz2
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar.lz
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar.xz
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.tar.zst
nixlib-cc2eeef4abfaf484363d43d6bcce510f0f16dc1d.zip
Fix installing the Nixpkgs channel on the installation media
And test that it got installed correctly.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index b51779cfb957..87013dc8f977 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -12,6 +12,7 @@ umask 0022
 extraBuildFlags=()
 
 mountPoint=/mnt
+channelPath=
 
 while [ "$#" -gt 0 ]; do
     i="$1"; shift 1
@@ -28,10 +29,12 @@ while [ "$#" -gt 0 ]; do
         --root)
             mountPoint="$1"; shift 1
             ;;
-        --closure)
-            # FIXME: --closure is a misnomer
+        --system|--closure)
             system="$1"; shift 1
             ;;
+        --channel)
+            channelPath="$1"; shift 1
+            ;;
         --no-channel-copy)
             noChannelCopy=1
             ;;
@@ -104,7 +107,9 @@ nix-env --store "$mountPoint" "${extraBuildFlags[@]}" \
 # Copy the NixOS/Nixpkgs sources to the target as the initial contents
 # of the NixOS channel.
 if [[ -z $noChannelCopy ]]; then
-    channelPath="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")"
+    if [[ -z $channelPath ]]; then
+        channelPath="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")"
+    fi
     if [[ -n $channelPath ]]; then
         echo "copying channel..."
         mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root