Terms and Definitions in Nix Project: Difference between revisions
imported>Nix m add note about connection to profiles and generations |
imported>Nix order most important items more prominently. better explain profiles and generations |
||
| Line 8: | Line 8: | ||
|- | |- | ||
! Term || Context || Meaning || Related Links | ! Term || 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. This is an important concept further explored in [[User Environment]]. ''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 | |||
|| Most generally, a ''profile'' is a link to a ''generation'', and there's a '''profiles''' (note the '''s''') folder which collects types of profiles together so that they form lists of generations. In standalone Nix (e.g. on a different Linux distro), it's primary use is user profiles. In NixOS, there's also the ''system'' profile, which manages system-wide configuration (e.g. ''/etc'', the kernel, ''initrd'', ''systemd''). Tools like [[Home Manager]] also have their own profile (which would also be per-user). The user's ''active profile'' is defined in ''~/.nix-profile'', and is what all '''nix-env''' commands would operate on by default.<code> | |||
❯ ls -l ~/.nix-profile<br> | |||
lrwxrwxrwx 1 username users ... /home/username/.nix-profile -> /nix/var/nix/profiles/per-user/username/profile</code> | |||
|| [http://nixos.org/nix/manual/#sec-profiles Nix Manual: Profiles] | |||
|-------- | |||
|| <div id="generation"></div>Generation | |||
|| Nix | |||
|| A revision of a user environment, newly created every time the system is updated (with old ones being preserved until manually removed). Technically, each generation is simply a link to a specific ''user environment'' in the Nix store. This term connotes the cloning and modification of an existing user environment. Nix's environment rollback facilities rely on Generations. The ''current generation'' is a user's currently selected ''user environment'', and is generally selected via the ''active profile'' (which is just a symlink, normally in ''/nix/var/nix/profiles/''). | |||
|| [http://nixos.org/nix/manual/#sec-profiles Nix Manual: Profiles] | |||
|-------- | |||
|| 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>rec { }</code> | || <code>rec { }</code> | ||
| Line 18: | Line 40: | ||
|| 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] <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] <code>--arg</code> <br> [http://nixos.org/nix/manual/#ssec-builtins Nix Manual: Built-in Functions] | ||
|-------- | |-------- | ||
|| <code>stdenv</code> | || <code>stdenv</code> | ||
| Line 28: | Line 45: | ||
|| 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>]] | ||
|-------- | |-------- | ||
|| <code>config.nix</code> or <code>nixpkgs-config.nix</code> | || <code>config.nix</code> or <code>nixpkgs-config.nix</code> | ||