diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index 7800968f1..40c3ccdcc 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -17,6 +17,8 @@ public: const Setting sshKey{(Store*) this, "", "ssh-key", "path to an SSH private key"}; const Setting sshPublicHostKey{(Store*) this, "", "base64-ssh-public-host-key", "The public half of the host's SSH key"}; const Setting compress{(Store*) this, false, "compress", "whether to compress the connection"}; + const Setting remoteProgram{this, "nix-daemon", "remote-program", "path to the nix-daemon executable on the remote system"}; + const Setting remoteStore{this, "", "remote-store", "URI of the store on the remote system"}; SSHStore(const std::string & host, const Params & params) : Store(params) @@ -84,7 +86,9 @@ ref SSHStore::getFSAccessor() ref SSHStore::openConnection() { auto conn = make_ref(); - conn->sshConn = master.startCommand("nix-daemon --stdio"); + conn->sshConn = master.startCommand( + fmt("%s --stdio", remoteProgram) + + (remoteStore.get() == "" ? "" : " --store " + shellEscape(remoteStore.get()))); conn->to = FdSink(conn->sshConn->in.get()); conn->from = FdSource(conn->sshConn->out.get()); initConnection(*conn);