Skip to content
Snippets Groups Projects
Commit cebc150b authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

nix: Add --store flag

This is a bit user-friendlier than using $NIX_REMOTE.
parent 1c5f73f5
No related branches found
No related tags found
No related merge requests found
......@@ -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));
}
}
......@@ -18,9 +18,8 @@ class Store;
/* A command that require a Nix store. */
struct StoreCommand : virtual Command
{
bool reserveSpace;
StoreCommand(bool reserveSpace = true)
: reserveSpace(reserveSpace) { };
std::string storeUri;
StoreCommand();
void run() override;
virtual void run(ref<Store>) = 0;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment