about summary refs log tree commit diff
path: root/src/nix-instantiate
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r--src/nix-instantiate/main.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc
index 7d12c201fb14..3e9fad4ae4c3 100644
--- a/src/nix-instantiate/main.cc
+++ b/src/nix-instantiate/main.cc
@@ -29,6 +29,7 @@ static Expr evalStdin(EvalState & state, bool parseOnly)
 
 static Path gcRoot;
 static int rootNr = 0;
+static bool indirectRoot = false;
 
 
 /* Print out the paths of the resulting derivation(s).  If the user
@@ -51,7 +52,8 @@ static void printDrvPaths(EvalState & state, Expr e)
                     printGCWarning();
                 else
                     drvPath = addPermRoot(drvPath,
-                        makeRootName(gcRoot, rootNr));
+                        makeRootName(gcRoot, rootNr),
+                        indirectRoot);
                 cout << format("%1%\n") % drvPath;
                 return;
             }
@@ -110,8 +112,10 @@ void run(Strings args)
         else if (arg == "--add-root") {
             if (i == args.end())
                 throw UsageError("`--add-root requires an argument");
-            gcRoot = *i++;
+            gcRoot = absPath(*i++);
         }
+        else if (arg == "--indirect")
+            indirectRoot = true;
         else if (arg[0] == '-')
             throw UsageError(format("unknown flag `%1%`") % arg);
         else