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

@ -17,7 +17,11 @@ Machine::Machine(decltype(storeUri) storeUri,
storeUri(
// Backwards compatibility: if the URI is a hostname,
// prepend ssh://.
storeUri.find("://") != std::string::npos || hasPrefix(storeUri, "local") || hasPrefix(storeUri, "remote") || hasPrefix(storeUri, "auto")
storeUri.find("://") != std::string::npos
|| hasPrefix(storeUri, "local")
|| hasPrefix(storeUri, "remote")
|| hasPrefix(storeUri, "auto")
|| hasPrefix(storeUri, "/")
? storeUri
: "ssh://" + storeUri),
systemTypes(systemTypes),