Nix (package manager): Difference between revisions

Rszyma (talk | contribs)
m Remove dead link
DHCP (talk | contribs)
m update links
Line 4: Line 4:
{{Navbox Nix}}
{{Navbox Nix}}
{{Disambiguation|message=This article is about the Nix package manager. Not to be confused with the [[Nix ecosystem]], the [[Nix (language)|Nix language]] or the [[Nix (command)|Nix command]].}}
{{Disambiguation|message=This article is about the Nix package manager. Not to be confused with the [[Nix ecosystem]], the [[Nix (language)|Nix language]] or the [[Nix (command)|Nix command]].}}
Nix is a package manager and build system that parses reproducible build instructions specified in the [[Nix Expression Language]], a pure functional language with lazy evaluation. Nix expressions are pure functions<ref>Values cannot change during computation. Functions always produce the same output if their input does not change. </ref>taking dependencies as arguments and producing a ''[[Derivations|derivation]]'' specifying a reproducible build environment for the package. Nix stores the results of the build in unique addresses specified by a hash of the complete dependency tree, creating an immutable package store (aka the [[#Nix store|nix store]]) that allows for atomic upgrades, rollbacks and concurrent installation of different versions of a package, essentially eliminating [https://en.wikipedia.org/wiki/Dependency_hell dependency hell].  
Nix is a package manager and build system that parses reproducible build instructions specified in the [[Nix (language)|Nix Expression Language]], a pure functional language with lazy evaluation. Nix expressions are pure functions<ref>Values cannot change during computation. Functions always produce the same output if their input does not change. </ref>taking dependencies as arguments and producing a ''[[Derivations|derivation]]'' specifying a reproducible build environment for the package. Nix stores the results of the build in unique addresses specified by a hash of the complete dependency tree, creating an immutable package store (aka the [[#Nix store|nix store]]) that allows for atomic upgrades, rollbacks and concurrent installation of different versions of a package, essentially eliminating [[Wikipedia:Dependency hell|dependency hell]].


== Usage == <!--T:2-->
== Usage == <!--T:2-->
Line 13: Line 13:


<!--T:4-->
<!--T:4-->
On other Linux distributions or on macOS, you can install Nix following the [https://nixos.org/manual/nix/stable/installation/installation installation section of the Nix manual].
On other Linux distributions or on macOS, you can install Nix following the [https://nix.dev/manual/nix/stable/installation/ installation section of the Nix manual].


=== Nix commands === <!--T:5-->
=== Nix commands === <!--T:5-->


<!--T:6-->
<!--T:6-->
The [[Nix (command line utilities)|Nix commands]] are documented in the [https://nixos.org/manual/nix/stable/command-ref/command-ref Nix reference manual]: main commands, utilities and experimental commands. Prior to version 2.0 (released in February 2018) there have been different commands.
The [[Nix (command line utilities)|Nix commands]] are documented in the [https://nix.dev/manual/nix/stable/command-ref/ Nix reference manual]: main commands, utilities and experimental commands. Prior to version 2.0 (released in February 2018) there have been different commands.


<!--T:7-->
<!--T:7-->
Line 25: Line 25:


<!--T:8-->
<!--T:8-->
Standalone Nix is configured through <code>nix.conf</code> (usually found in <code>/etc/nix/</code>). Details on the available options are [https://nixos.org/manual/nix/stable/command-ref/conf-file found in the Nix reference manual].  
Standalone Nix is configured through <code>nix.conf</code> (usually found in <code>/etc/nix/</code>). Details on the available options are [https://nix.dev/manual/nix/stable/command-ref/conf-file found in the Nix reference manual].  


<!--T:9-->
<!--T:9-->
You can also configure Nix using [[Home Manager]], which manages declarative environments for a single user. For system-wide configuration, you can use [https://github.com/numtide/system-manager System Manager] on Linux and [https://github.com/LnL7/nix-darwin nix-darwin] on macOS.
You can also configure Nix using [[Home Manager]], which manages declarative environments for a single user. For system-wide configuration, you can use [https://github.com/numtide/system-manager System Manager] on Linux and [https://github.com/nix-darwin/nix-darwin nix-darwin] on macOS.


== Internals == <!--T:10-->
== Internals == <!--T:10-->
Line 78: Line 78:


<!--T:21-->
<!--T:21-->
* [https://cs.tvl.fyi/depot/-/tree/tvix tvix]
* [https://code.tvl.fyi/tree/tvix tvix]


<!--T:22-->
<!--T:22-->