about summary refs log tree commit diff
path: root/scripts/nix-collect-garbage.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2012-01-03T12·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2012-01-03T12·59+0000
commit6c31232e1494d1d68a31fb8433dbf593f831dff2 (patch)
tree9acd7f0e2279bd971b5ccd1f1eb8cec8b7937003 /scripts/nix-collect-garbage.in
parent502d94048ae848eda1fcda2d1e72b339eaa653aa (diff)
parent63227d434cefaa9faeb14afe28ebeb9b2d449ee2 (diff)
* Sync with the trunk.
Diffstat (limited to 'scripts/nix-collect-garbage.in')
-rwxr-xr-xscripts/nix-collect-garbage.in7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in
index f445c1c71256..00e61a24b785 100755
--- a/scripts/nix-collect-garbage.in
+++ b/scripts/nix-collect-garbage.in
@@ -1,11 +1,10 @@
 #! @perl@ -w
 
 use strict;
+use Nix::Config;
 
 my $profilesDir = "@localstatedir@/nix/profiles";
 
-my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
-
 
 # Process the command line arguments.
 my @args = ();
@@ -36,7 +35,7 @@ sub removeOldGenerations {
         $name = $dir . "/" . $name;
         if (-l $name && (readlink($name) =~ /link/)) {
             print STDERR "removing old generations of profile $name\n";
-            system("$binDir/nix-env", "-p", $name, "--delete-generations", "old");
+            system("$Nix::Config::binDir/nix-env", "-p", $name, "--delete-generations", "old");
         }
         elsif (! -l $name && -d $name) {
             removeOldGenerations $name;
@@ -50,4 +49,4 @@ removeOldGenerations $profilesDir if $removeOld;
 
 
 # Run the actual garbage collector.
-exec "$binDir/nix-store", "--gc", @args;
+exec "$Nix::Config::binDir/nix-store", "--gc", @args;