nix: Add --store flag

This is a bit user-friendlier than using $NIX_REMOTE.
This commit is contained in:
Eelco Dolstra 2016-03-21 18:03:36 +01:00
parent 1c5f73f529
commit cebc150b7c
2 changed files with 10 additions and 4 deletions

View file

@ -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));
}
}