about summary refs log tree commit diff
path: root/src/libstore/machines.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-10-24T13·16+0200
committerEelco Dolstra <edolstra@gmail.com>2017-10-24T13·32+0200
commitd16fd2497374671c92cb877f9570d65783a77d99 (patch)
treece2a871f4d9e5a65108768f1f8584cd545cbd6ac /src/libstore/machines.cc
parent3460e4cf007017e89096b4fad083692666b87a20 (diff)
Allow shorter syntax for chroot stores
You can now say '--store /tmp/nix' instead of '--store local?root=/tmp/nix'.
Diffstat (limited to 'src/libstore/machines.cc')
-rw-r--r--src/libstore/machines.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc
index d2faf45357e3..edd03d147832 100644
--- a/src/libstore/machines.cc
+++ b/src/libstore/machines.cc
@@ -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),