summary refs log tree commit diff
path: root/modules/installer/tools/nixos-install.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-03-02 12:38:22 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-03-02 12:38:22 +0000
commit29d84af677a4909777aaac85b5799534590f95f1 (patch)
treecddbfef6603f39955aa831347d04089917e110bf /modules/installer/tools/nixos-install.sh
parentd4f3443d33f1a5ed5d07ac8f915ae92cda3192b2 (diff)
downloadnixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar.gz
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar.bz2
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar.lz
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar.xz
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.tar.zst
nixpkgs-29d84af677a4909777aaac85b5799534590f95f1.zip
* Remove the use of the NIXPKGS and NIXOS environment variables.
  Instead use $NIX_PATH.  NIXOS_CONFIG is still supported.

svn path=/nixos/trunk/; revision=32739
Diffstat (limited to 'modules/installer/tools/nixos-install.sh')
-rw-r--r--modules/installer/tools/nixos-install.sh23
1 files changed, 5 insertions, 18 deletions
diff --git a/modules/installer/tools/nixos-install.sh b/modules/installer/tools/nixos-install.sh
index 5b7746b6162..e1b4ac4da1f 100644
--- a/modules/installer/tools/nixos-install.sh
+++ b/modules/installer/tools/nixos-install.sh
@@ -15,10 +15,6 @@ if test -z "$mountPoint"; then
     mountPoint=/mnt
 fi
 
-if test -z "$NIXOS"; then
-    NIXOS=/etc/nixos/nixos
-fi
-
 # NIXOS_CONFIG is interpreted relative to $mountPoint.
 if test -z "$NIXOS_CONFIG"; then
     NIXOS_CONFIG=/etc/nixos/configuration.nix
@@ -34,20 +30,12 @@ if ! grep -F -q " $mountPoint " /proc/mounts; then
     exit 1
 fi
     
-if ! test -e "$NIXOS"; then
-    echo "NixOS source directory $NIXOS doesn't exist"
-    exit 1
-fi
-    
 if ! test -e "$mountPoint/$NIXOS_CONFIG"; then
     echo "configuration file $mountPoint/$NIXOS_CONFIG doesn't exist"
     exit 1
 fi
     
 
-NIXOS=$(readlink -f "$NIXOS")
-
-
 # Enable networking in the chroot.
 mkdir -m 0755 -p $mountPoint/etc
 touch /etc/resolv.conf 
@@ -153,10 +141,9 @@ fi
 # Build the specified Nix expression in the target store and install
 # it into the system configuration profile.
 echo "building the system configuration..."
-NIXPKGS=/mnt/etc/nixos/nixpkgs chroot $mountPoint @nix@/bin/nix-env \
-    -p /nix/var/nix/profiles/system \
-    -f "/mnt$NIXOS" \
-    --set -A system
+NIX_PATH=nixpkgs=/mnt/etc/nixos/nixpkgs:nixos=/mnt/etc/nixos/nixos \
+    chroot $mountPoint @nix@/bin/nix-env \
+    -p /nix/var/nix/profiles/system -f '<nixos>' --set -A system
 
 
 # Make a backup of the old NixOS/Nixpkgs sources.
@@ -176,8 +163,8 @@ fi
 
 
 # Copy the NixOS/Nixpkgs sources to the target.
-cp -prd $NIXOS $targetNixos
-if test -e /etc/nixos/nixpkgs; then
+cp -prd /etc/nixos/nixos $targetNixos
+if [ -e /etc/nixos/nixpkgs ]; then
     cp -prd /etc/nixos/nixpkgs $targetNixpkgs
 fi