Add 'nix store ping' manpage

This commit is contained in:
Eelco Dolstra 2020-12-09 17:55:59 +01:00
parent f34b1801a4
commit 53ce20eab7
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 35 additions and 8 deletions

View file

@ -8,17 +8,14 @@ struct CmdPingStore : StoreCommand
{
std::string description() override
{
return "test whether a store can be opened";
return "test whether a store can be accessed";
}
Examples examples() override
std::string doc() override
{
return {
Example{
"To test whether connecting to a remote Nix store via SSH works:",
"nix store ping --store ssh://mac1"
},
};
return
#include "ping-store.md"
;
}
void run(ref<Store> store) override

30
src/nix/ping-store.md Normal file
View file

@ -0,0 +1,30 @@
R""(
# Examples
* Test whether connecting to a remote Nix store via SSH works:
```console
# nix store ping --store ssh://mac1
```
* Test whether a URL is a valid binary cache:
```console
# nix store ping --store https://cache.nixos.org
```
* Test whether the Nix daemon is up and running:
```console
# nix store ping --store daemon
```
# Description
This command tests whether a particular Nix store (specified by the
argument `--store` *url*) can be accessed. What this means is
dependent on the type of the store. For instance, for an SSH store it
means that Nix can connect to the specified machine.
)""