Nix (package manager): Difference between revisions

imported>Ixxie
No edit summary
imported>Ixxie
Line 42: Line 42:
==== Channels ====
==== Channels ====


Nix ''channels'' are mechanisms for distributing Nix expressions as well as the associated binaries for them; a Nix channel corresponds to a repository in a conventional package management system. Official Nix channels are automatically updated once tests are passed in Nixpkgs' [[Hydra]] instance. It is also possible to create one's own Nix channels, but here we focus the official channels. See the NixOS site for [https://nixos.org/channels/ a full list of official channels].
Nix packages are distributed through a number of Nix channels: mechanisms for distributing Nix expressions as well as the associated binary caches for them. These channels are what determine which versions your packages have, and they can be broadly categorized into ''stable'' and ''unstable'' channels. Most users will want the stable channel, currently <code>nixos-17.09</code>. For more information on channels and how to choose them, see the [[Nix Channels]] article.
 
NixOS is distributed through a number of channels. These NixOS channels can be broadly categorised into ''stable'' and ''unstable'' channels, and ''large'' and ''small'' channels:
 
* Stable/unstable:
** Stable channels (<code>nixos-17.09</code>) provide conservative updates for fixing bugs and security vulnerabilities, but do not receive major updates after initial release. New stable channels are released every six months.
** Unstable channels (<code>nixos-unstable</code>, <code>nixos-unstable-small</code>) correspond to the main development branch of Nixpkgs, delivering the latest tested updates on a rolling basis.
* Large/small:
** Large channels (<code>nixos-17.09</code>, <code>nixos-unstable</code>) provide binary builds for the full breadth of Nixpkgs.
** Small channels (<code>nixos-17.09-small</code>, <code>nixos-unstable-small</code>) are identical to large channels, but contain fewer binaries. This means they update faster, but require more to be built from source.
 
Most users will want the stable/large channel, currently <code>nixos-17.09</code>.
 
Like packages installed via <code>nix-env</code>, channels are managed at user-level. The following are the most common commands for Nix channel management:


{| class="wikitable"
{| class="wikitable"
Line 78: Line 65:
|<code>nix-channel --update</code>
|<code>nix-channel --update</code>
|}
|}
Note that updating channels won't cause a rebuild in itself; if you want to update channels and rebuild, you can run <code>nixos rebuild --upgrade</code> to do both in one step.


== Internals ==
== Internals ==