| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | --- | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | title: Preface | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | author: Frederik Rietdijk | 
					
						
							|  |  |  |  | date: 2015-11-25 | 
					
						
							|  |  |  |  | --- | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | # Preface
 | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | [Nix package manager](https://nixos.org/nix/), released under a | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | [permissive MIT/X11 license](https://github.com/NixOS/nixpkgs/blob/master/COPYING). | 
					
						
							|  |  |  |  | Packages are available for several platforms, and can be used with the Nix | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | package manager on most GNU/Linux distributions as well as [NixOS](https://nixos.org/nixos). | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | This manual primarily describes how to write packages for the Nix Packages collection | 
					
						
							|  |  |  |  | (Nixpkgs). Thus it’s mainly for packagers and developers who want to add packages to | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | Nixpkgs. If you like to learn more about the Nix package manager and the Nix | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | expression language, then you are kindly referred to the [Nix manual](https://nixos.org/nix/manual/). | 
					
						
							|  |  |  |  | The NixOS distribution is documented in the [NixOS manual](https://nixos.org/nixos/manual/). | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | ## Overview of Nixpkgs
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Nix expressions describe how to build packages from source and are collected in | 
					
						
							|  |  |  |  | the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | collection are Nix expressions for | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | [NixOS modules](https://nixos.org/nixos/manual/index.html#sec-writing-modules). | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | With these expressions the Nix package manager can build binary packages. | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | Packages, including the Nix packages collection, are distributed through | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | [channels](https://nixos.org/nix/manual/#sec-channels). The collection is | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | distributed for users of Nix on non-NixOS distributions through the channel | 
					
						
							|  |  |  |  | `nixpkgs`. Users of NixOS generally use one of the `nixos-*` channels, e.g. | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | `nixos-19.09`, which includes all packages and modules for the stable NixOS | 
					
						
							|  |  |  |  | 19.09. Stable NixOS releases are generally only given | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | security updates. More up to date packages and modules are available via the | 
					
						
							|  |  |  |  | `nixos-unstable` channel. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Both `nixos-unstable` and `nixpkgs` follow the `master` branch of the Nixpkgs | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | repository, although both do lag the `master` branch by generally | 
					
						
							| 
									
										
										
										
											2020-04-02 21:52:44 -04:00
										 |  |  |  | [a couple of days](https://status.nixos.org/). Updates to a channel are | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | distributed as soon as all tests for that channel pass, e.g. | 
					
						
							| 
									
										
										
										
											2019-10-28 11:40:40 +01:00
										 |  |  |  | [this table](https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents) | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | shows the status of tests for the `nixpkgs` channel. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-18 22:51:19 +02:00
										 |  |  |  | The tests are conducted by a cluster called [Hydra](https://nixos.org/hydra/), | 
					
						
							| 
									
										
										
										
											2016-04-05 09:56:32 +02:00
										 |  |  |  | which also builds binary packages from the Nix expressions in Nixpkgs for | 
					
						
							|  |  |  |  | `x86_64-linux`, `i686-linux` and `x86_64-darwin`. | 
					
						
							|  |  |  |  | The binaries are made available via a [binary cache](https://cache.nixos.org). | 
					
						
							| 
									
										
										
										
											2015-11-25 17:13:44 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | The current Nix expressions of the channels are available in the | 
					
						
							| 
									
										
										
										
											2019-10-17 19:43:07 +02:00
										 |  |  |  | [`nixpkgs`](https://github.com/NixOS/nixpkgs) repository in branches | 
					
						
							|  |  |  |  | that correspond to the channel names (e.g. `nixos-19.09-small`). |