about summary refs log tree commit diff
path: root/src/nix/command.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-03-21T17·03+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-03-21T17·03+0100
commitcebc150b7ccf534612d7d8c75200c1717e986566 (patch)
treeb3db195e6f64fbf78e27a4e85777b86c1e00975a /src/nix/command.cc
parent1c5f73f529d83543dc776b4de4180309bfd3b4a3 (diff)
nix: Add --store flag
This is a bit user-friendlier than using $NIX_REMOTE.
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r--src/nix/command.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index 9c80f43093c5..0c2103392f8e 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -57,9 +57,16 @@ bool MultiCommand::processArgs(const Strings & args, bool finish)
         return Args::processArgs(args, finish);
 }
 
+StoreCommand::StoreCommand()
+{
+    storeUri = getEnv("NIX_REMOTE");
+
+    mkFlag(0, "store", "store-uri", "URI of the Nix store to use", &storeUri);
+}
+
 void StoreCommand::run()
 {
-    run(openStore());
+    run(openStoreAt(storeUri));
 }
 
 }