about summary refs log tree commit diff
path: root/src/build-remote
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/build-remote
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/build-remote')
-rw-r--r--src/build-remote/build-remote.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 419e7205372b..6e05e165545d 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -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();