1# Preface {#preface}
2
3The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the
4[Nix package manager](https://nixos.org/nix/), released under a
5[permissive MIT license](https://github.com/NixOS/nixpkgs/blob/master/COPYING).
6Packages are available for several platforms, and can be used with the Nix
7package manager on most GNU/Linux distributions as well as [NixOS](https://nixos.org/nixos).
8
9This manual primarily describes how to write packages for the Nix Packages collection
10(Nixpkgs). Thus it’s mainly for packagers and developers who want to add packages to
11Nixpkgs. If you like to learn more about the Nix package manager and the Nix
12expression language, then you are kindly referred to the [Nix manual](https://nixos.org/nix/manual/).
13The NixOS distribution is documented in the [NixOS manual](https://nixos.org/nixos/manual/).
14
15## Overview of Nixpkgs {#overview-of-nixpkgs}
16
17Nix expressions describe how to build packages from source and are collected in
18the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the
19collection are Nix expressions for
20[NixOS modules](https://nixos.org/nixos/manual/index.html#sec-writing-modules).
21With these expressions the Nix package manager can build binary packages.
22
23Packages, including the Nix packages collection, are distributed through
24[channels](https://nixos.org/nix/manual/#sec-channels). The collection is
25distributed for users of Nix on non-NixOS distributions through the channel
26`nixpkgs`. Users of NixOS generally use one of the `nixos-*` channels, e.g.
27`nixos-22.11`, which includes all packages and modules for the stable NixOS
2822.11. Stable NixOS releases are generally only given
29security updates. More up to date packages and modules are available via the
30`nixos-unstable` channel.
31
32Both `nixos-unstable` and `nixpkgs` follow the `master` branch of the Nixpkgs
33repository, although both do lag the `master` branch by generally
34[a couple of days](https://status.nixos.org/). Updates to a channel are
35distributed as soon as all tests for that channel pass, e.g.
36[this table](https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents)
37shows the status of tests for the `nixpkgs` channel.
38
39The tests are conducted by a cluster called [Hydra](https://nixos.org/hydra/),
40which also builds binary packages from the Nix expressions in Nixpkgs for
41`x86_64-linux`, `i686-linux` and `x86_64-darwin`.
42The binaries are made available via a [binary cache](https://cache.nixos.org).
43
44The current Nix expressions of the channels are available in the
45[`nixpkgs`](https://github.com/NixOS/nixpkgs) repository in branches
46that correspond to the channel names (e.g. `nixos-22.11-small`).