1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Allow shorter syntax for chroot stores

You can now say '--store /tmp/nix' instead of '--store local?root=/tmp/nix'.
This commit is contained in:
Eelco Dolstra 2017-10-24 15:16:18 +02:00
parent 3460e4cf00
commit d16fd24973
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 23 additions and 11 deletions

View file

@ -176,9 +176,13 @@ int main (int argc, char * * argv)
Activity act(*logger, lvlTalkative, actUnknown, fmt("connecting to '%s'", bestMachine->storeUri));
Store::Params storeParams{{"max-connections", "1"}, {"log-fd", "4"}};
if (bestMachine->sshKey != "")
storeParams["ssh-key"] = bestMachine->sshKey;
Store::Params storeParams;
if (hasPrefix(storeUri, "ssh://")) {
storeParams["max-connections"] ="1";
storeParams["log-fd"] = "4";
if (bestMachine->sshKey != "")
storeParams["ssh-key"] = bestMachine->sshKey;
}
sshStore = openStore(bestMachine->storeUri, storeParams);
sshStore->connect();