The directory used by Nix to store store paths (including derivations).
Nix Store
-
First steps with Nix
Neither
nix run
nornix shell
will mutate your system environment, aside from changing the Nix Store. If you would like to permanently install a package somewhere under your $HOME directory, you can do so usingnix profile install
:These symlinks, ultimately, point to the package Store path outputs under the Nix Store, viz.:
What is a Nix “package”? Technically, a Nix package is a special Store path built using instructions from a Derivation, both of which reside in the Nix Store. To see what is contained by the
cowsay
package, look inside its Store path. To get the store path for a package (here,cowsay
), runnix build
as follows:[!info] Nix Store & Store Paths
/nix/store
is a special directory representing the Nix Store. The paths inside/nix/store
are known as Store path. Nix fundamentally is, in large part, about manipulating these store paths in a pure and reproducible fashion; Derivation are “recipes” that does this manipulation, and they too live in the Nix Store.