about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-10T15·05+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-10T15·05+0100
commit20cf0127f5a0cfd417bc7256db23f6eef2ad8141 (patch)
tree969493e770474ea8cd1e46bffddc7790035f7104 /scripts
parente529823635c8efee0d96a73fb90117ac81040710 (diff)
Include cacert in the binary tarball
This prevents having to fetch Nixpkgs or cacert over http.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/install-nix-from-closure.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh
index 467fc50d62..9977dca2ca 100644
--- a/scripts/install-nix-from-closure.sh
+++ b/scripts/install-nix-from-closure.sh
@@ -5,6 +5,7 @@ set -e
 dest="/nix"
 self="$(dirname "$0")"
 nix="@nix@"
+cacert="@cacert@"
 
 if ! [ -e $self/.reginfo ]; then
     echo "$0: incomplete installer (.reginfo is missing)" >&2
@@ -66,7 +67,7 @@ fi
 
 . $nix/etc/profile.d/nix.sh
 
-if ! $nix/bin/nix-env -i $nix; then
+if ! $nix/bin/nix-env -i "$nix"; then
     echo "$0: unable to install Nix into your default profile" >&2
     exit 1
 fi
@@ -80,7 +81,9 @@ if [ -z "$_NIX_INSTALLER_TEST" ]; then
 fi
 
 # Install an SSL certificate bundle.
-$nix/bin/nix-env -iA nixpkgs.cacert || true
+if [ -z "$SSL_CERT_FILE" ]; then
+    $nix/bin/nix-env -i "$cacert"
+fi
 
 # Make the shell source nix.sh during login.
 p=$NIX_LINK/etc/profile.d/nix.sh