about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/download-using-manifests.pl.in2
-rw-r--r--scripts/nix-install-package.in5
-rw-r--r--scripts/nix-pull.in15
3 files changed, 11 insertions, 11 deletions
diff --git a/scripts/download-using-manifests.pl.in b/scripts/download-using-manifests.pl.in
index 6246ed3f62d5..20c01db3cfca 100644
--- a/scripts/download-using-manifests.pl.in
+++ b/scripts/download-using-manifests.pl.in
@@ -9,7 +9,7 @@ my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
 
 STDOUT->autoflush(1);
 
-my $manifestDir = "@localstatedir@/nix/manifests";
+my $manifestDir = ($ENV{"NIX_MANIFESTS_DIR"} or "@localstatedir@/nix/manifests");
 my $logFile = "@localstatedir@/log/nix/downloads";
 
 
diff --git a/scripts/nix-install-package.in b/scripts/nix-install-package.in
index e37911e33438..9f848b16dcbf 100644
--- a/scripts/nix-install-package.in
+++ b/scripts/nix-install-package.in
@@ -123,6 +123,11 @@ if ($interactive) {
 }
 
 
+# Store the manifest in the temporary directory so that we don't
+# pollute /nix/var/nix/manifests.
+$ENV{NIX_MANIFESTS_DIR} = $tmpDir;
+
+
 print "\nPulling manifests...\n";
 system("$binDir/nix-pull", $manifestURL) == 0
     or barf "nix-pull failed: $?";
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index ac2e3e3ed027..856ee80fa9c8 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -8,15 +8,10 @@ my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
     or die "cannot create a temporary directory";
 
 my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
-
-my $libexecDir = $ENV{"NIX_LIBEXEC_DIR"};
-$libexecDir = "@libexecdir@" unless defined $libexecDir;
-
-my $stateDir = $ENV{"NIX_STATE_DIR"};
-$stateDir = "@localstatedir@/nix" unless defined $stateDir;
-
-my $storeDir = $ENV{"NIX_STORE_DIR"};
-$storeDir = "@storedir@" unless defined $storeDir;
+my $libexecDir = ($ENV{"NIX_LIBEXEC_DIR"} or "@libexecdir@");
+my $storeDir = ($ENV{"NIX_STORE_DIR"} or "@storedir@");
+my $stateDir = ($ENV{"NIX_STATE_DIR"} or "@localstatedir@/nix");
+my $manifestDir = ($ENV{"NIX_MANIFESTS_DIR"} or "$stateDir/manifests");
 
 
 # Prevent access problems in shared-stored installations.
@@ -92,7 +87,7 @@ sub processURL {
         or die "cannot hash `$manifest'";
     chomp $hash;
     
-    my $finalPath = "$stateDir/manifests/$baseName-$hash.nixmanifest";
+    my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest";
     
     system("@coreutils@/ln", "-sfn", "$manifest", "$finalPath") == 0
         or die "cannot link `$finalPath to `$manifest'";