mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
85c8be6286
This was useful for an experiment with building Nix as a single compilation unit. It's not very useful otherwise but also doesn't hurt...
32 lines
689 B
C++
32 lines
689 B
C++
#include "command.hh"
|
|
#include "shared.hh"
|
|
#include "store-api.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct CmdPingStore : StoreCommand
|
|
{
|
|
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"
|
|
},
|
|
};
|
|
}
|
|
|
|
Category category() override { return catUtility; }
|
|
|
|
void run(ref<Store> store) override
|
|
{
|
|
store->connect();
|
|
}
|
|
};
|
|
|
|
static auto rCmdPingStore = registerCommand<CmdPingStore>("ping-store");
|