about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/build-remote/build-remote.cc4
-rw-r--r--src/libstore/store-api.cc4
-rw-r--r--src/libstore/store-api.hh2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index fd710c2b6b71..3908dfac487d 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -233,7 +233,9 @@ int main (int argc, char * * argv)
                 lock = -1;
 
                 try {
-                    sshStore = openStore("ssh://" + bestMachine->hostName + "?ssh-key=" + bestMachine->sshKey);
+                    sshStore = openStore("ssh://" + bestMachine->hostName,
+                        { {"ssh-key", bestMachine->sshKey },
+                          {"max-connections", "1" } });
                     hostName = bestMachine->hostName;
                 } catch (std::exception & e) {
                     printError("unable to open SSH connection to ‘%s’: %s; trying other available machines...",
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 401b001b2d8f..9c755965e45b 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -708,7 +708,11 @@ ref<Store> openStore(const std::string & uri_)
         }
         uri = uri_.substr(0, q);
     }
+    return openStore(uri, params);
+}
 
+ref<Store> openStore(const std::string & uri, const Store::Params & params)
+{
     for (auto fun : *RegisterStoreImplementation::implementations) {
         auto store = fun(uri, params);
         if (store) return ref<Store>(store);
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index c344b9d66ed3..481d0b799068 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -642,6 +642,8 @@ void removeTempRoots();
    set to true *unless* you're going to collect garbage. */
 ref<Store> openStore(const std::string & uri = getEnv("NIX_REMOTE"));
 
+ref<Store> openStore(const std::string & uri, const Store::Params & params);
+
 
 void copyPaths(ref<Store> from, ref<Store> to, const Paths & storePaths, bool substitute = false);