Store URL format:
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
local denotes a store that uses
/ as its root
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
chroot-ing into root. Chroot stores only support
building and running on Linux when
mount namespaces and
user namespaces are
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
Here, the "physical" store location is
Nix's store metadata is in
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
directory where Nix will store log files.
Size of the in-memory store path metadata cache.
Priority of this store when used as a substituter. A lower value means a higher priority.
Allow this store to be opened when its database is on a read-only filesystem.
Normally Nix will attempt to open the store database in read-write mode, even for querying (when write access is not needed), causing it to fail if the database is on a read-only filesystem.
Enable read-only mode to disable locking and open the SQLite database with the
Warning Do not use this unless the filesystem is read-only.
Using it when the filesystem is writable can cause incorrect query results or corruption errors if the database is changed by another process. While the filesystem the database resides on might appear to be read-only, consider whether another user or system might have write access to it.
Physical path of the Nix store.
Whether store paths copied into this store should have a trusted signature.
Directory prefixed to all other paths.
Directory where Nix will store state.
Logical location of the Nix store, usually
/nix/store. Note that you can only copy store paths between stores if they have the same
Optional system features available on the system this store uses to build derivations.
Whether paths from this store can be used as substitutes even if they are not signed by a key listed in the
Whether this store can be queried efficiently for path validity when used as a substituter.