Warning
This program is experimental and its interface is subject to change.
Name
nix help-stores - show help about store types and their settings
Synopsis
nix help-stores [option...]
Nix supports different types of stores. These are described below.
Store URL format
Stores are specified using a URL-like syntax. For example, the command
# 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/storeif/nix/var/nixis writable by the current user. -
Otherwise, if
/nix/var/nix/daemon-socket/socketexists, connect to the Nix daemon listening on that socket. -
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.
Dummy Store
Store URL format: dummy://
This store type represents a store that contains no store paths and cannot be written to. It's useful when you want to use the Nix evaluator when no actual Nix store exists, e.g.
# nix eval --store dummy:// --expr '1 + 2'
Settings:
-
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false
Experimental SSH Store
Store URL format: ssh-ng://[username@]hostname
Experimental store type that allows full access to a Nix store on a remote machine.
Settings:
-
base64-ssh-public-host-keyThe public host key of the remote machine.
Default: empty
-
compressWhether to enable SSH compression.
Default:
false -
max-connection-ageMaximum age of a connection before it is closed.
Default:
4294967295 -
max-connectionsMaximum number of concurrent connections to the Nix daemon.
Default:
1 -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
remote-programPath to the
nix-daemonexecutable on the remote machine.Default:
nix-daemon -
remote-storeStore URL to be used on the remote machine. The default is
auto(i.e. use the Nix daemon or/nix/storedirectly).Default: empty
-
ssh-keyPath to the SSH private key used to authenticate to the remote machine.
Default: empty
-
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false
HTTP Binary Cache Store
Store URL format: http://..., https://...
This store allows a binary cache to be accessed via the HTTP protocol.
Settings:
-
compressionNAR compression method (
xz,bzip2,gzip,zstd, ornone).Default:
xz -
compression-levelThe preset level to be used when compressing NARs. The meaning and accepted values depend on the compression method selected.
-1specifies that the default compression level should be used.Default:
-1 -
index-debug-infoWhether to index DWARF debug info files by build ID. This allows
dwarffsto fetch debug info on demandDefault:
false -
local-nar-cachePath to a local cache of NARs fetched from this binary cache, used by commands such as
nix store cat.Default: empty
-
parallel-compressionEnable multi-threaded compression of NARs. This is currently only available for
xzandzstd.Default:
false -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
secret-keyPath to the secret key used to sign the binary cache.
Default: empty
-
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false -
write-nar-listingWhether to write a JSON file that lists the files in each NAR.
Default:
false
Local Binary Cache Store
Store URL format: file://path
This store allows reading and writing a binary cache stored in path in the local filesystem. If path does not exist, it will be created.
For example, the following builds or downloads nixpkgs#hello into
the local store and then copies it to the binary cache in
/tmp/binary-cache:
# nix copy --to file:///tmp/binary-cache nixpkgs#hello
Settings:
-
compressionNAR compression method (
xz,bzip2,gzip,zstd, ornone).Default:
xz -
compression-levelThe preset level to be used when compressing NARs. The meaning and accepted values depend on the compression method selected.
-1specifies that the default compression level should be used.Default:
-1 -
index-debug-infoWhether to index DWARF debug info files by build ID. This allows
dwarffsto fetch debug info on demandDefault:
false -
local-nar-cachePath to a local cache of NARs fetched from this binary cache, used by commands such as
nix store cat.Default: empty
-
parallel-compressionEnable multi-threaded compression of NARs. This is currently only available for
xzandzstd.Default:
false -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
secret-keyPath to the secret key used to sign the binary cache.
Default: empty
-
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false -
write-nar-listingWhether to write a JSON file that lists the files in each NAR.
Default:
false
Local Daemon Store
Store URL format: daemon, unix://path
This store type accesses a Nix store by talking to a Nix daemon
listening on the Unix domain socket path. The store pseudo-URL
daemon is equivalent to unix:///nix/var/nix/daemon-socket/socket.
Settings:
-
logdirectory where Nix will store log files.
Default:
/nix/var/log/nix -
max-connection-ageMaximum age of a connection before it is closed.
Default:
4294967295 -
max-connectionsMaximum number of concurrent connections to the Nix daemon.
Default:
1 -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
realPhysical path of the Nix store.
Default:
/nix/store -
rootDirectory prefixed to all other paths.
Default: empty
-
stateDirectory where Nix will store state.
Default:
/dummy -
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false
Local Store
Store URL format: local, root
This store type accesses a Nix store in the local filesystem directly
(i.e. not via the Nix daemon). root is an absolute path that is
prefixed to other directories such as the Nix store directory. The
store pseudo-URL local denotes a store that uses / as its root
directory.
A store that uses a root other than / is called a chroot
store. With such stores, the store directory is "logically" still
/nix/store, so programs stored in them can only be built and
executed by chroot-ing into root. Chroot stores only support
building and running on Linux when mount namespaces and user namespaces are
enabled.
For example, the following uses /tmp/root as the chroot environment
to build or download nixpkgs#hello and then execute it:
# nix run --store /tmp/root nixpkgs#hello
Hello, world!
Here, the "physical" store location is /tmp/root/nix/store, and
Nix's store metadata is in /tmp/root/nix/var/nix/db.
It is also possible, but not recommended, to change the "logical"
location of the Nix store from its default of /nix/store. This makes
it impossible to use default substituters such as
https://cache.nixos.org/, and thus you may have to build everything
locally. Here is an example:
# nix build --store 'local?store=/tmp/my-nix/store&state=/tmp/my-nix/state&log=/tmp/my-nix/log' nixpkgs#hello
Settings:
-
logdirectory where Nix will store log files.
Default:
/nix/var/log/nix -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
realPhysical path of the Nix store.
Default:
/nix/store -
require-sigsWhether store paths copied into this store should have a trusted signature.
Default:
true -
rootDirectory prefixed to all other paths.
Default: empty
-
stateDirectory where Nix will store state.
Default:
/dummy -
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false
S3 Binary Cache Store
Store URL format: s3://bucket-name
This store allows reading and writing a binary cache stored in an AWS S3 bucket.
Settings:
-
buffer-sizeSize (in bytes) of each part in multi-part uploads.
Default:
5242880 -
compressionNAR compression method (
xz,bzip2,gzip,zstd, ornone).Default:
xz -
compression-levelThe preset level to be used when compressing NARs. The meaning and accepted values depend on the compression method selected.
-1specifies that the default compression level should be used.Default:
-1 -
endpointThe URL of the endpoint of an S3-compatible service such as MinIO. Do not specify this setting if you're using Amazon S3.
Note
This endpoint must support HTTPS and will use path-based addressing instead of virtual host based addressing.
Default: empty
-
index-debug-infoWhether to index DWARF debug info files by build ID. This allows
dwarffsto fetch debug info on demandDefault:
false -
local-nar-cachePath to a local cache of NARs fetched from this binary cache, used by commands such as
nix store cat.Default: empty
-
log-compressionCompression method for
log/*files. It is recommended to use a compression method supported by most web browsers (e.g.brotli).Default: empty
-
ls-compressionCompression method for
.lsfiles.Default: empty
-
multipart-uploadWhether to use multi-part uploads.
Default:
false -
narinfo-compressionCompression method for
.narinfofiles.Default: empty
-
parallel-compressionEnable multi-threaded compression of NARs. This is currently only available for
xzandzstd.Default:
false -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
profileThe name of the AWS configuration profile to use. By default Nix will use the
defaultprofile.Default: empty
-
regionThe region of the S3 bucket. If your bucket is not in
us–east-1, you should always explicitly specify the region parameter.Default:
us-east-1 -
schemeThe scheme used for S3 requests,
https(default) orhttp. This option allows you to disable HTTPS for binary caches which don't support it.Note
HTTPS should be used if the cache might contain sensitive information.
Default: empty
-
secret-keyPath to the secret key used to sign the binary cache.
Default: empty
-
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false -
write-nar-listingWhether to write a JSON file that lists the files in each NAR.
Default:
false
SSH Store
Store URL format: ssh://[username@]hostname
This store type allows limited access to a remote store on another machine via SSH.
Settings:
-
base64-ssh-public-host-keyThe public host key of the remote machine.
Default: empty
-
compressWhether to enable SSH compression.
Default:
false -
max-connectionsMaximum number of concurrent SSH connections.
Default:
1 -
path-info-cache-sizeSize of the in-memory store path metadata cache.
Default:
65536 -
priorityPriority of this store when used as a substituter. A lower value means a higher priority.
Default:
0 -
remote-programPath to the
nix-storeexecutable on the remote machine.Default:
nix-store -
remote-storeStore URL to be used on the remote machine. The default is
auto(i.e. use the Nix daemon or/nix/storedirectly).Default: empty
-
ssh-keyPath to the SSH private key used to authenticate to the remote machine.
Default: empty
-
storeLogical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the samestoresetting.Default:
/nix/store -
system-featuresOptional features that the system this store builds on implements (like "kvm").
Default:
benchmark big-parallel kvm nixos-test uid-range -
trustedWhether paths from this store can be used as substitutes even if they are not signed by a key listed in the
trusted-public-keyssetting.Default:
false -
want-mass-queryWhether this store (when used as a substituter) can be queried efficiently for path validity.
Default:
false