Terms and Definitions in Nix Project: Difference between revisions

From NixOS Wiki
imported>Fadenb
No edit summary
m Minor wording changes and an updated link to the manual page on recursive sets.
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Terms and Definitions ==
If you come across a term or word you don't know, add it here.
If you come across a term or word you don't know, add it here.


<!-- README: Rows in this table with named divs have been linked to in other pages. Avoid renaming or removing any of the divs. -->
{| class="wikitable"
{| class="wikitable"
|-  
|-  
! Term || Context || Meaning || Related Links
! scope="col" style="width:50px;" | Term
! scope="col" style="width: 60px;" | Context
! Meaning
! Related Links
|--------
|| <div id="user_environment"></div>[[User Environment]]
|| Nix
|| A set of "active" applications. These applications usually exist in the Nix store. A single Nix user may have multiple ''user environments''. ''Profiles'' and ''generations'' are closely related.
|| {{Nix Manual|name=Nix Manual - Basic Package Management chapter|anchor=#ch-basic-package-mgmt}} <br>{{Nix Manual|name=Nix Manual - Profiles chapter|anchor=#sec-profiles}} <br>{{Nix Manual|name=Nix Manual - nix-env|anchor=#sec-nix-env}}
|--------
|| (User) Profile
|| Nix
|| Profiles simplify managing and switching between ''user environments'', and thus control which applications and system configurations are in active use. Generally, a ''profile'' is a link to a ''generation'', and the corresponding '''profiles''' folder collects a list of generations. A standalone Nix installation (i.e. on a Linux distro that is not NixOS) operates mainly on ''user'' profiles. In NixOS, there is also a ''system'' profile that manages the system-wide configuration (e.g. ''/etc'', the kernel, ''initrd'', ''systemd''). Other tools like [[Home Manager]] may also have their own profiles. By default, a user's active profile is stored at ''~/.nix-profile'':
<syntaxHighlight lang=shell>
$ ls -l ~/.nix-profile
lrwxrwxrwx ... /home/username/.nix-profile ->
/nix/var/nix/profiles/per-user/username/profile
</syntaxHighlight>
|| [http://nixos.org/nix/manual/#sec-profiles Nix Manual: Profiles]<br>[https://nixos.org/guides/nix-pills/install-on-your-running-system.html#idm140737320787760 Nix Pills - The first profile]
|--------
|| <div id="generation"></div>Generation
|| Nix
|| An instance of a ''user environment''. When a user makes any change to their environment, such as installing or removing packages, a new ''generation'' of the environment is created instead of modifying the environment in-place. This ensures that updates are atomic and the user can easily roll-back to any previous generation if something goes wrong. The ''current generation'' is a user's currently active user profile.
|| [https://nix.dev/manual/nix/stable/package-management/profiles Nix Manual: Profiles]
|--------
|| Derivation
|| Nix
|| A Nix expression which describes a build action. Derivations are analogous to package definitions in other package managers. High-level derivations, such as the ones describing packages in [[Nixpkgs]], get evaluated into low-level derivations (called ''store derivations''), for instance by using the <code>nix-instantiate</code> command. <code>nix-store --realise</code> runs the build commands described in the low-level derivation, producing one or more ''output paths''. <code>nix-build</code> is a user-friendly wrapper for the previous two commands.
|| [http://nixos.org/nix/manual/#gloss-derivation Nix Manual: Glossary - Derivation] <br> [http://nixos.org/nix/manual/#ssec-derivation Nix Manual: Derivation]
|--------
|| Output path
|| Nix
|| A ''store path'' produced by a derivation. These are generally analogous to built packages, or pieces of them.
<syntaxHighlight lang=shell>
$ ls -ld /nix/store/*-firefox-9*/
dr-xr-xr-x ... /nix/store/v4b8...3d0w-firefox-92.0/
</syntaxHighlight>
|| [http://nixos.org/nix/manual/#ssec-derivation Nix Manual: Derivation]
|--------
|--------
|| <code>rec { }</code>
|| <code>rec { }</code>
|| Nix expressions
|| Nix expressions
|| The <code>{ }</code> block contains "mutually recursive" attributes, which means they can refer to each other.
|| The <code>{ }</code> block contains "mutually recursive" attributes, which means they can refer to each other.
|| [http://nixos.org/nix/manual/#ex-hello-composition Composing the Hello Package]
|| [https://nix.dev/manual/nix/2.24/language/syntax.html#recursive-sets Nix Manual: Syntax and semantics: Recursive sets]
|--------
|--------
|| <code>expression evaluator</code>
|| <code>expression evaluator</code>
Line 17: Line 52:
|| The part of the Nix program which reads and evaluates a Nix expression.
|| The part of the Nix program which reads and evaluates a Nix expression.
|| [http://nixos.org/nix/manual/#sec-common-options Nix Manual: Common Options]&nbsp;<code>--arg</code> <br> [http://nixos.org/nix/manual/#ssec-builtins Nix Manual: Built-in Functions]
|| [http://nixos.org/nix/manual/#sec-common-options Nix Manual: Common Options]&nbsp;<code>--arg</code> <br> [http://nixos.org/nix/manual/#ssec-builtins Nix Manual: Built-in Functions]
|--------
|| Derivation
|| Nix
|| A Nix expression which describes a build action. When evaluated, it creates one or more entries in the Nix Store. The <code>nix-instantiate</code> command is the command which creates entries in the Nix Store, while the <code>nix-env</code> and <code>nix-build</code> commands are its user-friendly interface.
|| [http://nixos.org/nix/manual/#gloss-derivation Nix Manual: Glossary -> Derivation] <br> [http://nixos.org/nix/manual/#ssec-derivation Nix Manual: Derivation]
|--------
|--------
|| <code>stdenv</code>
|| <code>stdenv</code>
Line 27: Line 57:
|| An attribute which contains things expected in the most basic Unix environment. (e.g. Bash shell, <code>gcc</code>, <code>cp</code>, <code>tar</code>, <code>grep</code>, etc.)
|| An attribute which contains things expected in the most basic Unix environment. (e.g. Bash shell, <code>gcc</code>, <code>cp</code>, <code>tar</code>, <code>grep</code>, etc.)
|| [https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L224 all-packages.nix: <code>stdenv =</code>]]
|| [https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L224 all-packages.nix: <code>stdenv =</code>]]
|--------
|| User Environment
|| Nix
|| A set of "active" applications. These applications often exist in the Nix store. A single Nix user may have multiple User Environments.
|| [http://nixos.org/nix/manual/#idp26825824 Nix Manual: Glossary]
|--------
|| User Profile
|| Nix
|| A user's currently selected User Environment.
|| [http://nixos.org/nix/manual/#idp26825824 Nix Manual: Glossary]
|--------
|| Generation
|| Nix
|| A past revision of a user's environment. This term connotes the cloning and modification of an existing user environment. Nix's environment rollback facilities rely on Generations.
|| [http://nixos.org/nix/manual/#sec-profiles Nix Manual: Profiles]
|--------
|--------
|| <code>config.nix</code> or <code>nixpkgs-config.nix</code>
|| <code>config.nix</code> or <code>nixpkgs-config.nix</code>
Line 50: Line 65:
|--------
|--------
|| attribute path
|| attribute path
|| nix-env takes this if you pass the `-A` flag [http://nixos.org/nix/manual/#opt-attr]  
|| nix-env takes this if you pass the `-A` flag [http://nixos.org/nix/manual/#opt-attr]
|| an unambiguous identifier for a package
|| an unambiguous identifier for a package
||  
||  
Line 66: Line 81:
|| selection path
|| selection path
|| nix-shell error message [https://github.com/NixOS/nix/blob/bdc4a0b54d54146448061dd9a248212f98a9f801/src/libexpr/attr-path.cc#L73]
|| nix-shell error message [https://github.com/NixOS/nix/blob/bdc4a0b54d54146448061dd9a248212f98a9f801/src/libexpr/attr-path.cc#L73]
|| see "attribute path"[http://nixos.org/irc/logs/log.20151103]  
|| see "attribute path"[http://nixos.org/irc/logs/log.20151103]
||  
||  
|--------
|--------

Latest revision as of 15:21, 2 September 2024

If you come across a term or word you don't know, add it here.

Term Context Meaning Related Links
User Environment
Nix A set of "active" applications. These applications usually exist in the Nix store. A single Nix user may have multiple user environments. Profiles and generations are closely related.

Nix Manual - Basic Package Management chapter
Nix Manual - Profiles chapter
Nix Manual - nix-env

(User) Profile Nix Profiles simplify managing and switching between user environments, and thus control which applications and system configurations are in active use. Generally, a profile is a link to a generation, and the corresponding profiles folder collects a list of generations. A standalone Nix installation (i.e. on a Linux distro that is not NixOS) operates mainly on user profiles. In NixOS, there is also a system profile that manages the system-wide configuration (e.g. /etc, the kernel, initrd, systemd). Other tools like Home Manager may also have their own profiles. By default, a user's active profile is stored at ~/.nix-profile:
$ ls -l ~/.nix-profile
lrwxrwxrwx ... /home/username/.nix-profile ->
/nix/var/nix/profiles/per-user/username/profile
Nix Manual: Profiles
Nix Pills - The first profile
Generation
Nix An instance of a user environment. When a user makes any change to their environment, such as installing or removing packages, a new generation of the environment is created instead of modifying the environment in-place. This ensures that updates are atomic and the user can easily roll-back to any previous generation if something goes wrong. The current generation is a user's currently active user profile. Nix Manual: Profiles
Derivation Nix A Nix expression which describes a build action. Derivations are analogous to package definitions in other package managers. High-level derivations, such as the ones describing packages in Nixpkgs, get evaluated into low-level derivations (called store derivations), for instance by using the nix-instantiate command. nix-store --realise runs the build commands described in the low-level derivation, producing one or more output paths. nix-build is a user-friendly wrapper for the previous two commands. Nix Manual: Glossary - Derivation
Nix Manual: Derivation
Output path Nix A store path produced by a derivation. These are generally analogous to built packages, or pieces of them.
$ ls -ld /nix/store/*-firefox-9*/
dr-xr-xr-x ... /nix/store/v4b8...3d0w-firefox-92.0/
Nix Manual: Derivation
rec { } Nix expressions The { } block contains "mutually recursive" attributes, which means they can refer to each other. Nix Manual: Syntax and semantics: Recursive sets
expression evaluator Nix The part of the Nix program which reads and evaluates a Nix expression. Nix Manual: Common Options --arg
Nix Manual: Built-in Functions
stdenv Nix expressions An attribute which contains things expected in the most basic Unix environment. (e.g. Bash shell, gcc, cp, tar, grep, etc.) all-packages.nix: stdenv =]
config.nix or nixpkgs-config.nix NixOS Wiki A Nix expression retrieved by and applied to the all-packages.nix Nix expression. This file enables an end-user to customize the Nix expressions contained in the community-owned NixPkgs list or to define entirely new Nix expressions to use with Nix commands. This file's path can be overridden by the NIXPKGS_CONFIG environment variable. all-packages.nix: config

NixPkgs Release Notes

attribute path nix-env takes this if you pass the `-A` flag [1] an unambiguous identifier for a package
symbolic package name [2] This string represents what you commonly think of as a package. There can be multiple packages with the symbolic name "hello".
selector this term is used in nix-env error messages [3], it seems to be actually a DrvName struct [4] (a derivation name) see "symbolic package name"
selection path nix-shell error message [5] see "attribute path"[6]
derivation name manual[7], source code [8] see "symbolic package name"
package name IRC[9] see "symbolic package name"
attribute selection path source[10] see "attribute path"