Common environment variablesMost Nix commands interpret the following environment variables:NIX_ROOTIf NIX_ROOT is set, the Nix command
will on startup perform a chroot() to the
specified directory. This is useful in certain bootstrapping
situations (e.g., when installing a Nix installation onto a hard
disk from CD-ROM).NIX_IGNORE_SYMLINK_STORENormally, the Nix store directory (typically
/nix/store) is not allowed to contain any
symlink components. This is to prevent “impure” builds. Builders
sometimes “canonicalise” paths by resolving all symlink components.
Thus, builds on different machines (with
/nix/store resolving to different locations)
could yield different results. This is generally not a problem,
except when builds are deployed to machines where
/nix/store resolves differently. If you are
sure that you’re not going to do that, you can set
NIX_IGNORE_SYMLINK_STORE to 1.Note that if you’re symlinking the Nix store so that you can
put it on another file system than the root file system, on Linux
you’re better off using bind mount points, e.g.,
$ mkdir /nix
$ mount -o bind /mnt/otherdisk/nix /nix
Consult the mount8 manual page for details.NIX_STORE_DIROverrides the location of the Nix store (default
prefix/store).NIX_DATA_DIROverrides the location of the Nix static data
directory (default
prefix/share).NIX_LOG_DIROverrides the location of the Nix log directory
(default prefix/log/nix).NIX_STATE_DIROverrides the location of the Nix state directory
(default prefix/var/nix).NIX_DB_DIROverrides the location of the Nix database (default
$NIX_STATE_DIR/db, i.e.,
prefix/var/nix/db).NIX_CONF_DIROverrides the location of the Nix configuration
directory (default
prefix/etc/nix).NIX_LOG_TYPEEquivalent to the
option.TMPDIRUse the specified directory to store temporary
files. In particular, this includes temporary build directories;
these can take up substantial amounts of disk space. The default is
/tmp.