1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Manual: Update chapter on remote builds

Alos add a command "nix ping-store" to make it easier to see if Nix
can connect to a remote builder (e.g. 'nix ping-store --store
ssh://mac').
This commit is contained in:
Eelco Dolstra 2018-02-21 16:22:49 +01:00
parent e2d71bd186
commit 0d54671b7b
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 187 additions and 66 deletions

35
src/nix/ping-store.cc Normal file
View file

@ -0,0 +1,35 @@
#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
using namespace nix;
struct CmdPingStore : StoreCommand
{
std::string name() override
{
return "ping-store";
}
std::string description() override
{
return "test whether a store can be opened";
}
Examples examples() override
{
return {
Example{
"To test whether connecting to a remote Nix store via SSH works:",
"nix ping-store --store ssh://mac1"
},
};
}
void run(ref<Store> store) override
{
store->connect();
}
};
static RegisterCommand r1(make_ref<CmdPingStore>());