Nix (package manager): Difference between revisions

DoggoBit (talk | contribs)
m Add navbox
Weijia (talk | contribs)
Marked this version for translation
 
Line 34: Line 34:
=== Nix store === <!--T:11-->
=== Nix store === <!--T:11-->


<!--T:27-->
{{Split|reason=The nix store is conceptually separate enough that it warrants a separate article.}}
{{Split|reason=The nix store is conceptually separate enough that it warrants a separate article.}}


<!--T:28-->
Packages built by Nix are placed in the read-only ''Nix store'', normally found in <code>/nix/store</code>. Each package is given a unique address specified by a cryptographic hash followed by the package name and version, for example <code>/nix/store/nawl092prjblbhvv16kxxbk6j9gkgcqm-git-2.14.1</code>. These prefixes hash all the inputs to the build process, including the source files, the full dependency tree, compiler flags, etc. This allows Nix to simultaneously install different versions of the same package, and even different builds of the same version, for example variants built with different compilers. When adding, removing or updating a package, nothing is removed from the store; instead, symlinks to these packages are added, removed or changed in ''profiles''.
Packages built by Nix are placed in the read-only ''Nix store'', normally found in <code>/nix/store</code>. Each package is given a unique address specified by a cryptographic hash followed by the package name and version, for example <code>/nix/store/nawl092prjblbhvv16kxxbk6j9gkgcqm-git-2.14.1</code>. These prefixes hash all the inputs to the build process, including the source files, the full dependency tree, compiler flags, etc. This allows Nix to simultaneously install different versions of the same package, and even different builds of the same version, for example variants built with different compilers. When adding, removing or updating a package, nothing is removed from the store; instead, symlinks to these packages are added, removed or changed in ''profiles''.


==== Cleaning the Nix store ====
==== Cleaning the Nix store ==== <!--T:29-->


<!--T:30-->
For information relating to cleaning the Nix store, refer to {{NixOS Manual|name=NixOS Manual: Chapter - Cleaning the Nix Store|anchor=#sec-nix-gc}}.
For information relating to cleaning the Nix store, refer to {{NixOS Manual|name=NixOS Manual: Chapter - Cleaning the Nix Store|anchor=#sec-nix-gc}}.


==== Nix store corruption ====
==== Nix store corruption ==== <!--T:31-->


<!--T:32-->
For information relating to fixing a corrupted Nix store, refer to {{NixOS Manual|name=NixOS Manual: Chapter - Nix Store Corruption|anchor=#sec-nix-store-corruption}}.
For information relating to fixing a corrupted Nix store, refer to {{NixOS Manual|name=NixOS Manual: Chapter - Nix Store Corruption|anchor=#sec-nix-store-corruption}}.


==== Valid Nix store names ====
==== Valid Nix store names ==== <!--T:33-->


<!--T:34-->
{{main|Valid Nix store path names}}
{{main|Valid Nix store path names}}