about summary refs log tree commit diff
path: root/scripts/nix-collect-garbage.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-collect-garbage.in')
-rw-r--r--scripts/nix-collect-garbage.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in
index f11ed2cb696a..c92737f25c13 100644
--- a/scripts/nix-collect-garbage.in
+++ b/scripts/nix-collect-garbage.in
@@ -9,6 +9,7 @@ my $storeDir = "@storedir@";
 my %alive;
 
 my $gcOper = "--delete";
+my $extraArgs = "";
 
 my @roots = ();
 
@@ -19,6 +20,9 @@ for (my $i = 0; $i < scalar @ARGV; $i++) {
     if ($arg eq "--delete" || $arg eq "--print-live" || $arg eq "--print-dead") {
         $gcOper = $arg;
     }
+    elsif ($arg =~ /^-v+$/) {
+        $extraArgs = "$extraArgs $arg";
+    }
     else { die "unknown argument `$arg'" };
 }
 
@@ -66,7 +70,7 @@ findRoots 1, $rootsDir;
 
 
 # Run the collector with the roots we found.
-my $pid = open2(">&1", \*WRITE, "@bindir@/nix-store --gc $gcOper")
+my $pid = open2(">&1", \*WRITE, "@bindir@/nix-store --gc $gcOper $extraArgs")
     or die "cannot run `nix-store --gc'";
 
 foreach my $root (@roots) {