NixOS: Difference between revisions
imported>Ixxie No edit summary |
imported>Ixxie No edit summary |
||
Line 7: | Line 7: | ||
=== Installation === | === Installation === | ||
=== Declarative | === Declarative Configuration === | ||
One of NixOS's most distinguishing features is the ability to ''declaratively configure'' the whole system. This is done by specifying a configuration file which defines which packages are installed on the system, which services to run and various other settings and options. This file is normally called <code>configuration.nix</code> and is found by default at <code>/etc/nixos</code>, although another location can be set using the environment variable <code>NIX_PATH</code>. The system configuration is then built with the command <code>nixos-rebuild</code>. The following is an example of a <code>configuration.nix</code> file: | One of NixOS's most distinguishing features is the ability to ''declaratively configure'' the whole system. This is done by specifying a configuration file which defines which packages are installed on the system, which services to run and various other settings and options. This file is normally called <code>configuration.nix</code> and is found by default at <code>/etc/nixos</code>, although another location can be set using the environment variable <code>NIX_PATH</code>. The system configuration is then built with the command <code>nixos-rebuild</code>. The following is an example of a <code>configuration.nix</code> file: | ||
Line 65: | Line 65: | ||
For inspiration, a variety of NixOS configuration files made by community members can be found in the [[Configuration Collection]]. | For inspiration, a variety of NixOS configuration files made by community members can be found in the [[Configuration Collection]]. | ||
=== Imperative User Environment Management === | === Imperative Operations === | ||
==== User Environment Management ==== | |||
In addition to declarative system configuration, NixOS offers imperative commands to manage ''user specific'' package management. These operations are managed by the <code>nix-env</code> command line tool. The following is a summary of some common operations that can be performed with it: | In addition to declarative system configuration, NixOS offers imperative commands to manage ''user specific'' package management. These operations are managed by the <code>nix-env</code> command line tool. The following is a summary of some common operations that can be performed with it: | ||
Line 86: | Line 88: | ||
|} | |} | ||
=== Channels === | ==== Channels ==== | ||
Nix ''channels'' are mechanisms for distributing Nix expressions alongside the associated binaries for them. Nix channels are automatically updated once a certain tests are passed in Nixpkgs' Hydra instance. | |||
{| border="1" style="border-collapse:collapse" | |||
|+ Channel Types | |||
|Stable Channels | |||
|''nixos-17.03'' | |||
|These receive conservative updates for fixing bugs and security vulnerabilities. | |||
|- | |||
|The Unstable Channel | |||
|''nixos-unstable'' | |||
| Corresponds to the main development branch of Nixpkgs, delivering the latest tested updates. | |||
|- | |||
|Small Channels | |||
|''nixos-17.03-small'' or ''nixos-unstable-small'' | |||
| Identical to their normal namesakes, but containing fewer binaries. This means they update faster but require more to be built from source. | |||
|} | |||
== Internals == | == Internals == |