aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-09 17:55:59 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-21 13:32:28 +0100
commit53ce20eab779e0dd156af2ac9ec2318814edc7cf (patch)
tree8a47aefd32293a4fe1cd774261d0798f06473c17 /src
parentf34b1801a4ec9060504a6b712b52763e88b4341f (diff)
Add 'nix store ping' manpage
Diffstat (limited to 'src')
-rw-r--r--src/nix/ping-store.cc13
-rw-r--r--src/nix/ping-store.md30
2 files changed, 35 insertions, 8 deletions
diff --git a/src/nix/ping-store.cc b/src/nix/ping-store.cc
index 19b1a55c8..62b645b06 100644
--- a/src/nix/ping-store.cc
+++ b/src/nix/ping-store.cc
@@ -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
diff --git a/src/nix/ping-store.md b/src/nix/ping-store.md
new file mode 100644
index 000000000..322093091
--- /dev/null
+++ b/src/nix/ping-store.md
@@ -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.
+
+)""