aboutsummaryrefslogtreecommitdiff
path: root/src/nix/help-stores.md
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-03-23 10:38:48 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-03-23 10:38:48 +0100
commit161f4b0dea82bdaed7cf8928e523702f61cf899b (patch)
tree2aceb4a0a666fe205fdb230229c6a57f37f3543b /src/nix/help-stores.md
parent05d9918a9ce83b5881a32d3b8e1dd4ef596f995f (diff)
Document store URLs
Diffstat (limited to 'src/nix/help-stores.md')
-rw-r--r--src/nix/help-stores.md37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/nix/help-stores.md b/src/nix/help-stores.md
index 8f872cb79..aa381393b 100644
--- a/src/nix/help-stores.md
+++ b/src/nix/help-stores.md
@@ -4,7 +4,42 @@ Nix supports different types of stores. These are described below.
## Store URL format
-TODO
+Stores are specified using a URL-like syntax. For example, the command
+
+```console
+# nix path-info --store https://cache.nixos.org/ --json \
+ /nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1
+```
+
+fetches information about a store path in the HTTP binary cache
+located at https://cache.nixos.org/, which is a type of store.
+
+Store URLs can specify **store settings** using URL query strings,
+i.e. by appending `?name1=value1&name2=value2&...` to the URL. For
+instance,
+
+```
+--store ssh://machine.example.org?ssh-key=/path/to/my/key
+```
+
+tells Nix to access the store on a remote machine via the SSH
+protocol, using `/path/to/my/key` as the SSH private key. The
+supported settings for each store type are documented below.
+
+The special store URL `auto` causes Nix to automatically select a
+store as follows:
+
+* Use the local store `/nix/store` if `/nix/var/nix` is writable by
+ the current user.
+
+* Otherwise, if `/nix/var/nix/daemon-socket/socket` exists, [connect
+ to the Nix daemon listening on that socket](#local-daemon-store).
+
+* Otherwise, on Linux only, use the local chroot store
+ `~/.local/share/nix/root`, which will be created automatically if it
+ does not exist.
+
+* Otherwise, use the local store `/nix/store`.
@stores@