NixOS: Difference between revisions
No edit summary Tag: citing a blog or free web host |
Add a section for the wiki of nixos |
||
(40 intermediate revisions by 27 users not shown) | |||
Line 20: | Line 20: | ||
| family = [[Linux]] ([[Unix-like]]) |
| family = [[Linux]] ([[Unix-like]]) |
||
| released = 0.1 / {{Start date and age|2003|June|03}} |
| released = 0.1 / {{Start date and age|2003|June|03}} |
||
| latest release version = |
|||
| latest release version = 23.11<ref>{{Cite web|url=https://nixos.org/blog/announcements.html#nixos-23.11|title="NixOS 23.11 released"|date=29 Nov 2023 }}</ref> |
|||
{{Wikidata|property|preferred|references|P348|P548=Q2804309}} |
|||
| latest release date = {{ |
| latest release date = {{Start date and age|{{Wikidata|qualifier|single|P348|P548=Q2804309|P577}}}} |
||
| latest preview version = {{Wikidata|property|preferred|references|P348|P548=Q51930650}} |
|||
| latest preview date = {{Start date and age|{{Wikidata|qualifier|single|P348|P548=Q51930650|P577}}}} |
|||
| working state = Current |
| working state = Current |
||
| license = [[MIT License|MIT]]<ref>{{cite web|url=https://github.com/NixOS/nixpkgs/blob/master/nixos/COPYING |title=nixpkgs/COPYING at master · NixOS/nixpkgs · GitHub |publisher=Github.com |access-date=2015-09-19}}</ref><ref group="note" name="other licenses"/> |
| license = [[MIT License|MIT]]<ref>{{cite web|url=https://github.com/NixOS/nixpkgs/blob/master/nixos/COPYING |title=nixpkgs/COPYING at master · NixOS/nixpkgs · GitHub |publisher=Github.com |access-date=2015-09-19}}</ref><ref group="note" name="other licenses"/> |
||
Line 30: | Line 33: | ||
}} |
}} |
||
⚫ | '''NixOS''' is a [[Free and open-source software|free and open source]] [[Linux distribution]] based on the [[Nix (package manager)|Nix package manager]]. NixOS uses an immutable design and an atomic update model.<ref>{{cite web |url=https://www.howtogeek.com/what-is-an-immutable-linux-distro/ |title=What Is an Immutable Linux Distro, and Should You Use One? |access-date=2023-12-07 |archive-url=https://archive.today/20231207004143/https://www.howtogeek.com/what-is-an-immutable-linux-distro/ |archive-date=2023-12-07|publisher=HowToGeek.com |url-status=live}}</ref> Its use of a [[Declarative programming|declarative]] configuration system allows reproducibility and portability.<ref>{{cite web |url=http://distrowatch.com/table.php?distribution=nixos |title=DistroWatch.com: NixOS|publisher=Distrowatch.com|access-date=2015-09-19}}</ref> |
||
'''NixOS''' is a [[Free software|free]] and [[Open-source software|open source]] [[Linux distribution]] based on the purely functional [[Nix (package manager)]]. NixOS is composed using modules and packages defined in the [https://github.com/NixOS/nixpkgs nixpkgs] project. |
|||
NixOS is configured using composable modules, and relies on packages defined in the [https://github.com/NixOS/nixpkgs Nixpkgs] project. Package recipes and configurations are written in the purpose-built "Nix language" that ships with the Nix package manager. |
|||
⚫ | NixOS uses an immutable design and an atomic update model.<ref>{{cite web |url=https://www.howtogeek.com/what-is-an-immutable-linux-distro/ |title=What Is an Immutable Linux Distro, and Should You Use One? |access-date=2023-12-07 |archive-url=https://archive.today/ |
||
==History== |
|||
{{Expand section|date=December 2023}} |
{{Expand section|date=December 2023}} |
||
Nix began in 2003 as a research project led by Eelco Dolstra, who sought to develop a system for reliable software deployment. This work culminated in Dolstra's Ph.D. thesis, The Purely Functional Software Deployment Model, which proposed a novel approach to declarative, functional software configuration. His research, supervised by Eelco Visser at Utrecht University, laid the theoretical groundwork for Nix.<ref name="original-paper">{{cite book |first=Eelco |last=Dolstra |title=Software Configuration Management |chapter=Integrating Software Construction and Software Deployment |series=Lecture Notes in Computer Science |volume=2649 |pages=102–117 |year=2003 |doi=10.1007/3-540-39195-9_8 |isbn=978-3-540-14036-8 |chapter-url=https://nixos.org/~eelco/pubs/iscsd-scm11-final.pdf |archive-url=https://web.archive.org/web/20190421081837/https://nixos.org/~eelco/pubs/iscsd-scm11-final.pdf |url-status=dead |archive-date=2019-04-21 }}</ref><ref>{{cite thesis |type=Ph.D. |first=Eelco |last=Dolstra |title=The Purely Functional Software Deployment Model |url=https://nixos.org/~eelco/pubs/phd-thesis.pdf |archive-url=https://web.archive.org/web/20190609111633/https://nixos.org/~eelco/pubs/phd-thesis.pdf |url-status=dead |archive-date=2019-06-09 |date=2006}}</ref> |
|||
In 2006, NixOS was introduced as part of Armijn Hemel's Master's thesis, which explored applying Nix principles to a Linux distribution. This led to the creation of a unique, declarative configuration model that distinguished NixOS from other operating systems.<ref>{{Cite web |last=Dolstra |first=Eelco |title=Purely Functional System Configuration Management |url=https://www.usenix.org/legacy/event/hotos07/tech/full_papers/dolstra/dolstra_html/ |access-date=2024-03-04 |website=www.usenix.org}}</ref> |
|||
=== Versions === |
|||
⚫ | |||
The NixOS Foundation was established in 2015 in the Netherlands to support projects that implement the purely functional deployment model, ensuring the ongoing development and sustainability of NixOS and its ecosystem.<ref>{{cite web |url=http://nixos.org/nixos/foundation.html |title=Stichting NixOS Foundation |publisher=Nixos.org |access-date=2015-09-19}}</ref> |
|||
=== Wiki history === |
|||
The first NixOS community wiki was launched around 2010–2011 to centralize documentation and support collaborative knowledge-sharing. However, as community interest in maintaining the wiki waned, outdated and incorrect information accumulated, reducing its usefulness.<ref>{{cite web |title=NixOS Wiki: History |url=https://wiki.nixos.org/wiki/NixOS_Wiki:History |website=NixOS Wiki |access-date=2024-11-28 }}</ref> |
|||
In November 2015, Rok Garbas highlighted the decaying state of the wiki in his talk Make Nix Friendlier for Beginners, sparking widespread discussion in the community. While many developers argued that the Nix* manuals were a better repository for official documentation, no immediate solution was implemented.<ref>{{cite web |last=Garbas |first=Rok |title=Make Nix Friendlier for Beginners |url=https://media.ccc.de/v/nixcon2015-3-MakeNixfriendlierforBeginners#t=1365 |date=2015 |publisher=media.ccc.de }}</ref> |
|||
By mid-2016, spam bots had overwhelmed the wiki due to insufficient protection, leading to its official lockdown in August of that year. In February 2017, a GitHub issue was opened to discuss unlocking the wiki, but the debate resulted in no resolution. Finally, in May 2017, the wiki was permanently disabled, with an archive of its content made available on Archive.org.<ref>{{cite web |url=https://archive.org/details/wiki-nixos.org |title=NixOS Wiki Archive |access-date=2024-01-01}}</ref> |
|||
To fill the void, Jörg Thalheim (Mic92) launched the nixos-users GitHub wiki in April 2017. Although this platform allowed quick edits and community contributions, it lacked features such as search functionality and a table of contents. Shortly thereafter, Tristan Helmich (fadenb) created a new MediaWiki-based wiki on his own initiative, citing the poor user experience of the GitHub wiki. Felix Richter (makefu) later migrated content from the GitHub wiki to Helmich’s platform, ensuring its sustainability.<ref>{{cite web |last=Helmich |first=Tristan |title=MediaWiki for NixOS |url=https://nixos.wiki |access-date=2024-01-01}}</ref> |
|||
In January 2024, a new initiative to establish an official wiki was launched, resulting in the wiki instance currently in use. This revival reflects the community's renewed commitment to maintaining accurate, centralized documentation for NixOS users.<ref>{{cite web |title=NixOS Wiki: History |url=https://wiki.nixos.org/wiki/NixOS_Wiki:History |website=NixOS Wiki |access-date=2024-11-28 }}</ref> |
|||
⚫ | |||
{| class="wikitable sortable" |
{| class="wikitable sortable" |
||
! Name |
! Name |
||
! Date |
! Date |
||
|- |
|- |
||
| NixOS 13.10 |
| NixOS 13.10 "Aardvark" || {{dts|October 2013}} |
||
|- |
|- |
||
|- |
|- |
||
Line 102: | Line 119: | ||
|- |
|- |
||
| NixOS 23.11 "Tapir" || {{dts|November 2023}} |
| NixOS 23.11 "Tapir" || {{dts|November 2023}} |
||
|- |
|||
|- |
|||
| NixOS 24.05 "Uakari" || {{dts|May 2024}} |
|||
|- |
|||
|- |
|||
| NixOS 24.11 "Vicuna" || {{dts|November 2024}} |
|||
|- |
|||
|- |
|||
| NixOS 25.05 "Warbler" || {{dts|May 2025}} |
|||
|- |
|- |
||
|} |
|} |
||
NixOS publishes releases |
NixOS publishes stable releases twice a year, around the end of May and the end of November.<ref>{{cite web |url=https://nixos.org/governance.html|title=Governance|publisher=Nixos.org|archive-url=https://web.archive.org/web/20200816224244/https://nixos.org/governance.html|access-date=2020-08-28|archive-date=2020-08-16}}</ref><ref>{{Cite web|url=https://github.com/NixOS/rfcs/blob/master/rfcs/0080-nixos-release-schedule.md|title = Nix RFCS (Request for Comments)|website = [[GitHub]]|date = 17 December 2021}}</ref><ref>{{cite web |url=https://nixos.org/blog/announcements|title=Release Announcements|publisher=Nixos.org|access-date=2023-12-09}}</ref> |
||
== Features == |
== Features == |
||
[[File:Nixos-installer.png|thumb|NixOS |
[[File:Nixos-installer.png|thumb|NixOS graphical installer]] |
||
=== Declarative configuration model === |
=== Declarative configuration model === |
||
In NixOS, the entire operating |
In NixOS, the entire operating system—including the [[Kernel (operating system)|kernel]], applications, system packages, and [[Configuration file|configuration files]]—is built by the Nix package manager from a description in the [https://nixos.org/manual/nix/stable/language/index.html Nix language]. Building a new version will not overwrite previous versions.<ref>{{cite conference |url=https://edolstra.github.io/pubs/hotos-final.pdf |archive-url=https://web.archive.org/web/20200710064409/https://edolstra.github.io/pubs/hotos-final.pdf |url-status=live |archive-date=2020-07-10 |access-date=2023-07-19 |title=Purely Functional System Configuration Management |first1=Eelco |last1=Dolstra |first2=Armijn |last2=Hemel |conference=11th USENIX workshop on Hot topics in operating systems |date=2007-05-07 |location=San Diego, California, USA |conference-url=https://www.usenix.org/conference/hotosxi |publisher=USENIX Association}}</ref> |
||
A NixOS system is configured by writing a specification of the functionality that the user wants on their machine in a global configuration file (typically located in <code>/etc/nixos</code>). The following is a minimal |
A NixOS system is configured by writing a specification of the functionality that the user wants on their machine in a global configuration file (typically located in <code>/etc/nixos</code>). The following is a minimal specification of a machine running an SSH daemon:<ref>{{cite web |url=http://nixos.org/nixos/about.html |title=About NixOS|publisher=Nixos.org|access-date=2015-09-19}}</ref> |
||
<syntaxhighlight lang="nix"> |
<syntaxhighlight lang="nix"> |
||
Line 121: | Line 147: | ||
services.sshd.enable = true; |
services.sshd.enable = true; |
||
} |
} |
||
⚫ | |||
</syntaxhighlight> |
|||
Various services and options can be searched for at https://search.nixos.org/options. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Since Nix files are [[Purely functional programming|pure]] and [[Declarative programming|declarative]], evaluating them will always produce the same result, regardless of what packages or configuration files are on the system. |
Since Nix files are [[Purely functional programming|pure]] and [[Declarative programming|declarative]], evaluating them will always produce the same result, regardless of what packages or configuration files are on the system. |
||
NixOS has a transactional approach to configuration management, making configuration changes such as upgrades [[Atomic operation|atomic]]. For example, if an upgrade to a new configuration is interrupted by power failure the system will still be in a consistent state: it will either boot in the old or the new configuration.<ref>{{cite conference |url=https://edolstra.github.io/pubs/atomic-hotswup2008-final.pdf |archive-url=https://web.archive.org/web/20211113223110/https://edolstra.github.io/pubs/atomic-hotswup2008-final.pdf |url-status=live |archive-date=2021-11-13 |access-date=2023-07-19 |title=Atomic Upgrading of Distributed Systems |first1=Sander |last1=van der Burg |first2=Eelco |last2=Dolstra |first3=Merijn |last3=de Jonge |conference=1st International Workshop on Hot Topics in Software Upgrades |date=2008-10-20 |location=Nashville, Tennessee, USA |conference-url=https://dl.acm.org/doi/proceedings/10.1145/1490283 |publisher=Association for Computing Machinery |isbn=978-1-60558-304-4 |doi=10.1145/1490283.1490294}}</ref> |
NixOS has a transactional approach to configuration management, making configuration changes such as upgrades [[Atomic operation|atomic]]. For example, if an upgrade to a new configuration is interrupted by power failure, the system will still be in a consistent state: it will either boot in the old or the new configuration.<ref>{{cite conference |url=https://edolstra.github.io/pubs/atomic-hotswup2008-final.pdf |archive-url=https://web.archive.org/web/20211113223110/https://edolstra.github.io/pubs/atomic-hotswup2008-final.pdf |url-status=live |archive-date=2021-11-13 |access-date=2023-07-19 |title=Atomic Upgrading of Distributed Systems |first1=Sander |last1=van der Burg |first2=Eelco |last2=Dolstra |first3=Merijn |last3=de Jonge |conference=1st International Workshop on Hot Topics in Software Upgrades |date=2008-10-20 |location=Nashville, Tennessee, USA |conference-url=https://dl.acm.org/doi/proceedings/10.1145/1490283 |publisher=Association for Computing Machinery |isbn=978-1-60558-304-4 |doi=10.1145/1490283.1490294}}</ref> |
||
=== Rollbacks === |
=== Rollbacks === |
||
If, after a system update, the new configuration is undesirable, it can be [[Rollback (data management)|rolled back]] using a special command (<code>nixos-rebuild switch --rollback</code>). Every system configuration version automatically shows up in the system boot menu. If the new configuration crashes or does not boot properly, an older version can be selected. Rollbacks are lightweight operations that do not involve files being restored from copies.<ref>{{ |
If, after a system update, the new configuration is undesirable, it can be [[Rollback (data management)|rolled back]] using a special command (<code>nixos-rebuild switch --rollback</code>). Every system configuration version automatically shows up in the system boot menu. If the new configuration crashes or does not boot properly, an older version can be selected. Rollbacks are lightweight operations that do not involve files being restored from copies.<ref>{{citation |url=https://nixos.org/manual/nixos/stable/#sec-rollback|title=NixOS Manual - Rolling Back Configuration Changes|publisher=Nixos.org}}</ref> |
||
=== Reproducible system configurations === |
=== Reproducible system configurations === |
||
Line 138: | Line 161: | ||
=== Source-based model with binary cache === |
=== Source-based model with binary cache === |
||
The Nix build language used by NixOS specifies how to build packages from source. This makes it easy to adapt the system to user needs. However, building from source being a slow process, the package manager automatically downloads pre-built binaries from a cache server when they are available. It is possible to disable the binary cache and force building from source by using <code>--option substitute false</code> as an argument. This gives the flexibility of a source-based package management model, with the efficiency of a binary model.<ref>{{cite conference |url=https://edolstra.github.io/pubs/secsharing-ase2005-final.pdf |archive-url=https://web.archive.org/web/20211113230423/https://edolstra.github.io/pubs/secsharing-ase2005-final.pdf |url-status=live |archive-date=2021-11-13 |access-date=2023-07-19 |title=Secure Sharing Between Untrusted Users in a Transparent Source/Binary Deployment Model |first=Eelco |last=Dolstra |conference=20th IEEE/ACM International Conference on Automated Software Engineering |date=2005-11-07 |location=Long Beach, California, USA |conference-url=https://dl.acm.org/doi/proceedings/10.1145/1101908 |publisher=Association for Computing Machinery |isbn=978-1-58113-993-8 |doi=10.1145/1101908.1101933}}</ref> |
The Nix build language used by NixOS specifies how to build packages from source. This makes it easy to adapt the system to user needs. However, building from source being a slow process, the package manager automatically downloads pre-built binaries from a cache server when they are available. It is possible to disable the binary cache and force building from source by using <code>--option substitute false</code> as an argument. Changing any of the build options from the defaults will also cause packages to be built from source. This gives the flexibility of a source-based package management model, with the efficiency of a binary model.<ref>{{cite conference |url=https://edolstra.github.io/pubs/secsharing-ase2005-final.pdf |archive-url=https://web.archive.org/web/20211113230423/https://edolstra.github.io/pubs/secsharing-ase2005-final.pdf |url-status=live |archive-date=2021-11-13 |access-date=2023-07-19 |title=Secure Sharing Between Untrusted Users in a Transparent Source/Binary Deployment Model |first=Eelco |last=Dolstra |conference=20th IEEE/ACM International Conference on Automated Software Engineering |date=2005-11-07 |location=Long Beach, California, USA |conference-url=https://dl.acm.org/doi/proceedings/10.1145/1101908 |publisher=Association for Computing Machinery |isbn=978-1-58113-993-8 |doi=10.1145/1101908.1101933}}</ref> |
||
=== Consistency === |
=== Consistency === |
||
Line 163: | Line 186: | ||
{{quote|Compared to reports of NixOS from just two or three years ago, we found it was very simple to get it installed and working. This suggests that the tools are maturing well and reaching a certain level of polish, but from a first-time perspective we have no prior baseline to compare against. This is very much not a traditional distro, or even a traditional Unix, but it works and we can see the appeal.<ref>{{cite web|url= https://www.theregister.com/2022/12/13/nixos_2211_raccoon/|title=NixOS 22.11 'Raccoon': Like a proof of concept you can do things with OSes |
{{quote|Compared to reports of NixOS from just two or three years ago, we found it was very simple to get it installed and working. This suggests that the tools are maturing well and reaching a certain level of polish, but from a first-time perspective we have no prior baseline to compare against. This is very much not a traditional distro, or even a traditional Unix, but it works and we can see the appeal.<ref>{{cite web|url= https://www.theregister.com/2022/12/13/nixos_2211_raccoon/|title=NixOS 22.11 'Raccoon': Like a proof of concept you can do things with OSes |
||
|last=Proven|first=Liam |
|last=Proven|first=Liam}}</ref>}} |
||
NixOS 23.11 "Tapir" reviewed by Jesse Smith at [[DistroWatch]]: |
|||
{{quote|NixOS is a rare gem in that I don't think I ran into any errors while I was using it. The distribution was stable, it worked well with my hardware, and I didn't run into a single issue while running it. I feel NixOS is well worth a try, especially if you're a system administrator and want to deploy (or maintain) identical distributions across multiple machines.<ref>{{cite web|url= https://distrowatch.com/weekly.php?issue=20240401#nixos|title=NixOS 23.11 |
|||
|last=Smith|first=Jesse}}</ref>}} |
|||
==Notes== |
==Notes== |
||
Line 174: | Line 202: | ||
== See also == |
== See also == |
||
* [[GNU Guix System]] – an operating system built on [[GNU Guix]] that is inspired by Nix |
* [[GNU Guix System]] – an operating system built on [[GNU Guix]] that is inspired by Nix |
||
* [[Eelco Visser]] — {{quote|without him Eelco Dolstra would probably never have started the work that resulted in the Nix package manager <ref>{{cite web|url=https://sandervanderburg.blogspot.com/2022/04/in-memoriam-eelco-visser-1966-2022.html|title=In memoriam: Eelco Visser (1966-2022)|url-status=live}}</ref>}} |
|||
== References == |
== References == |
||
Line 181: | Line 208: | ||
==External links== |
==External links== |
||
* {{Official website}} |
* {{Official website}} |
||
* [https://wiki.nixos.org Official Wiki] |
|||
{{Linux distributions}} |
{{Linux distributions}} |
||
Line 191: | Line 218: | ||
[[Category:Source-based Linux distributions]] |
[[Category:Source-based Linux distributions]] |
||
[[Category:X86-64 Linux distributions]] |
[[Category:X86-64 Linux distributions]] |
||
[[Category:2003 software]] |
Latest revision as of 09:46, 28 November 2024
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
Developer | NixOS contributors
NixOS Foundation[1][2] |
---|---|
Written in | Nix expression language[note 1] |
OS family | Linux (Unix-like) |
Working state | Current |
Source model | Open source |
Initial release | 0.1 / June 3, 2003 |
Latest release | 24.05[3] / 31 May 2024 |
Latest preview | 24.11-pre[4] / 22 May 2024 |
Repository | |
Marketing target | General purpose |
Package manager | Nix |
Platforms | i686, x86-64, AArch64 |
Kernel type | Monolithic (Linux kernel) |
License | MIT[5][note 2] |
Official website | nixos |
NixOS is a free and open source Linux distribution based on the Nix package manager. NixOS uses an immutable design and an atomic update model.[6] Its use of a declarative configuration system allows reproducibility and portability.[7]
NixOS is configured using composable modules, and relies on packages defined in the Nixpkgs project. Package recipes and configurations are written in the purpose-built "Nix language" that ships with the Nix package manager.
This section needs expansion. You can help by adding to it. (December 2023) |
Nix began in 2003 as a research project led by Eelco Dolstra, who sought to develop a system for reliable software deployment. This work culminated in Dolstra's Ph.D. thesis, The Purely Functional Software Deployment Model, which proposed a novel approach to declarative, functional software configuration. His research, supervised by Eelco Visser at Utrecht University, laid the theoretical groundwork for Nix.[8][9]
In 2006, NixOS was introduced as part of Armijn Hemel's Master's thesis, which explored applying Nix principles to a Linux distribution. This led to the creation of a unique, declarative configuration model that distinguished NixOS from other operating systems.[10]
The NixOS Foundation was established in 2015 in the Netherlands to support projects that implement the purely functional deployment model, ensuring the ongoing development and sustainability of NixOS and its ecosystem.[11]
Wiki history
[edit]The first NixOS community wiki was launched around 2010–2011 to centralize documentation and support collaborative knowledge-sharing. However, as community interest in maintaining the wiki waned, outdated and incorrect information accumulated, reducing its usefulness.[12]
In November 2015, Rok Garbas highlighted the decaying state of the wiki in his talk Make Nix Friendlier for Beginners, sparking widespread discussion in the community. While many developers argued that the Nix* manuals were a better repository for official documentation, no immediate solution was implemented.[13]
By mid-2016, spam bots had overwhelmed the wiki due to insufficient protection, leading to its official lockdown in August of that year. In February 2017, a GitHub issue was opened to discuss unlocking the wiki, but the debate resulted in no resolution. Finally, in May 2017, the wiki was permanently disabled, with an archive of its content made available on Archive.org.[14]
To fill the void, Jörg Thalheim (Mic92) launched the nixos-users GitHub wiki in April 2017. Although this platform allowed quick edits and community contributions, it lacked features such as search functionality and a table of contents. Shortly thereafter, Tristan Helmich (fadenb) created a new MediaWiki-based wiki on his own initiative, citing the poor user experience of the GitHub wiki. Felix Richter (makefu) later migrated content from the GitHub wiki to Helmich’s platform, ensuring its sustainability.[15]
In January 2024, a new initiative to establish an official wiki was launched, resulting in the wiki instance currently in use. This revival reflects the community's renewed commitment to maintaining accurate, centralized documentation for NixOS users.[16]
Release version history
[edit]Name | Date |
---|---|
NixOS 13.10 "Aardvark" | October 2013 |
NixOS 14.04 "Baboon" | April 2014 |
NixOS 14.12 "Caterpillar" | December 2014 |
NixOS 15.09 "Dingo" | September 2015 |
NixOS 16.03 "Emu" | March 2016 |
NixOS 16.09 "Flounder" | September 2016 |
NixOS 17.03 "Gorilla" | March 2017 |
NixOS 17.09 "Hummingbird" | September 2017 |
NixOS 18.03 "Impala" | March 2018 |
NixOS 18.09 "Jellyfish" | September 2018 |
NixOS 19.03 "Koi" | March 2019 |
NixOS 19.09 "Loris" | September 2019 |
NixOS 20.03 "Markhor" | March 2020 |
NixOS 20.09 "Nightingale" | September 2020 |
NixOS 21.05 "Okapi" | May 2021 |
NixOS 21.11 "Porcupine" | November 2021 |
NixOS 22.05 "Quokka" | May 2022 |
NixOS 22.11 "Raccoon" | November 2022 |
NixOS 23.05 "Stoat" | May 2023 |
NixOS 23.11 "Tapir" | November 2023 |
NixOS 24.05 "Uakari" | May 2024 |
NixOS 24.11 "Vicuna" | November 2024 |
NixOS 25.05 "Warbler" | May 2025 |
NixOS publishes stable releases twice a year, around the end of May and the end of November.[17][18][19]
Features
[edit]Declarative configuration model
[edit]In NixOS, the entire operating system—including the kernel, applications, system packages, and configuration files—is built by the Nix package manager from a description in the Nix language. Building a new version will not overwrite previous versions.[20]
A NixOS system is configured by writing a specification of the functionality that the user wants on their machine in a global configuration file (typically located in /etc/nixos
). The following is a minimal specification of a machine running an SSH daemon:[21]
{
boot.loader.grub.device = "/dev/sda";
fileSystems."/".device = "/dev/sda1";
services.sshd.enable = true;
}
After changing the specification file, the system can be updated using the nixos-rebuild
command. This does everything necessary to create the new version of the system, including downloading and installing packages, and generating configuration files.
Reliable and atomic upgrades
[edit]Since Nix files are pure and declarative, evaluating them will always produce the same result, regardless of what packages or configuration files are on the system.
NixOS has a transactional approach to configuration management, making configuration changes such as upgrades atomic. For example, if an upgrade to a new configuration is interrupted by power failure, the system will still be in a consistent state: it will either boot in the old or the new configuration.[22]
Rollbacks
[edit]If, after a system update, the new configuration is undesirable, it can be rolled back using a special command (nixos-rebuild switch --rollback
). Every system configuration version automatically shows up in the system boot menu. If the new configuration crashes or does not boot properly, an older version can be selected. Rollbacks are lightweight operations that do not involve files being restored from copies.[23]
Reproducible system configurations
[edit]NixOS's declarative configuration model makes it easy to reproduce a system configuration on another machine. Copying the configuration file to the target machine and running the system update command generates the same system configuration (kernel, applications, system services, and so on) except for parts of the system not managed by the package manager, such as user data.
Source-based model with binary cache
[edit]The Nix build language used by NixOS specifies how to build packages from source. This makes it easy to adapt the system to user needs. However, building from source being a slow process, the package manager automatically downloads pre-built binaries from a cache server when they are available. It is possible to disable the binary cache and force building from source by using --option substitute false
as an argument. Changing any of the build options from the defaults will also cause packages to be built from source. This gives the flexibility of a source-based package management model, with the efficiency of a binary model.[24]
Consistency
[edit]The Nix package manager ensures that the running system is consistent with the logical specification of the system, meaning that it will rebuild all packages that need to be rebuilt. For instance, if the kernel is changed, then the package manager will ensure that external kernel modules will be rebuilt. Similarly, when a library is updated, it ensures that all the system packages use the new version, even packages statically linked to it.
Multi-user package management
[edit]There is no need for special privileges to install software in NixOS. In addition to the system-wide profile, every user has a dedicated profile in which they can install packages. Nix also allows multiple versions of a package to coexist, so different users can have different versions of the same package installed in their respective profiles. If two users install the same version of a package, only one copy will be built or downloaded. Nix's security model ensures that this is secure, because only the users explicitly trusted by the system configuration are allowed to use build parameters that would allow them to control the content of a derivation's output (such as adding impurities to the sandbox, or using an untrusted substituter).[clarification needed] Without those parameters, paths can only be substituted from a substituter trusted by the system, or a local sandboxed build which is implicitly trusted.
Implementation
[edit]NixOS is based on the Nix package manager, which stores all packages in isolation from each other in the package store.
Installed packages are identified by a cryptographic hash of all input used for their build. Changing the build instructions of a package modifies its hash, and that will result in a different package being installed in the package store. This system is also used to manage configuration files, ensuring that newer configurations do not overwrite older ones.
An implication of this is that NixOS does not follow the Filesystem Hierarchy Standard. The only exceptions are that a /bin/sh symlink is created to the version of bash in the Nix store (e.g. /nix/store/s/5rnfzla9kcx4mj5zdc7nlnv8na1najvg-bash-4.3.43/
), and while NixOS does have an /etc directory to keep system-wide configuration files, most files in that directory are symlinks to generated files in /nix/store, such as /nix/store/s2sjbl85xnrc18rl4fhn56irkxqxyk4p-sshd_config
. Not using global directories such as /bin is part of what allows multiple versions of a package to coexist.
Reception
[edit]Jesse Smith, reviewing NixOS 15.09 for DistroWatch Weekly in 2015,[25] wrote:
I very much like the way NixOS takes the worry out of upgrading packages by placing each change in its own "generation" and I found, from the end user's point of view, NixOS worked just the same as any other Linux distribution. Setting up NixOS is not for beginners, and I do not think NixOS is intended to be used as a general purpose desktop operating system. But what NixOS does do is give us a useful playground in which to examine the Nix package manager and I think this is very interesting technology which deserves further exploration and adoption by additional distributions.
A 2022 review of NixOS 21.11 "Porcupine" in Full Circle magazine concluded:
Overall NixOS Gnome 21.11 impresses as serious, neat and elegant. If you are a fan of the unmodified Gnome desktop, then you will find a lot to like here. The downside of this distribution is the steep learning curve for package management, including updates and the like. No matter which distribution you come from, you will have much to learn to be able to make Nix work well for you on the command-line.[26]
NixOS 22.11 "Raccoon" reviewed by Liam Proven at The Register:
Compared to reports of NixOS from just two or three years ago, we found it was very simple to get it installed and working. This suggests that the tools are maturing well and reaching a certain level of polish, but from a first-time perspective we have no prior baseline to compare against. This is very much not a traditional distro, or even a traditional Unix, but it works and we can see the appeal.[27]
NixOS 23.11 "Tapir" reviewed by Jesse Smith at DistroWatch:
NixOS is a rare gem in that I don't think I ran into any errors while I was using it. The distribution was stable, it worked well with my hardware, and I didn't run into a single issue while running it. I feel NixOS is well worth a try, especially if you're a system administrator and want to deploy (or maintain) identical distributions across multiple machines.[28]
Notes
[edit]- ^ Various other programming languages are used throughout NixOS (as of December 2023).
- ^ Various other licenses are used for software included with NixOS, for example the Linux kernel is licensed under the GNU GPL version 2.0 (as of December 2023)
See also
[edit]- GNU Guix System – an operating system built on GNU Guix that is inspired by Nix
References
[edit]- ^ "Community - nixos.org". Archived from the original on 2022-09-23. Retrieved 2022-09-23.
- ^ "NixOS/nixos-foundation - Github". GitHub. Archived from the original on 2022-09-23. Retrieved 2022-09-23.
- ^ "Release 24.05". GitHub. 31 May 2024. Retrieved 2 June 2024.
- ^ "Release 24.11-pre". GitHub. 22 May 2024. Retrieved 25 June 2024.
- ^ "nixpkgs/COPYING at master · NixOS/nixpkgs · GitHub". Github.com. Retrieved 2015-09-19.
- ^ "What Is an Immutable Linux Distro, and Should You Use One?". HowToGeek.com. Archived from the original on 2023-12-07. Retrieved 2023-12-07.
- ^ "DistroWatch.com: NixOS". Distrowatch.com. Retrieved 2015-09-19.
- ^ Dolstra, Eelco (2003). "Integrating Software Construction and Software Deployment" (PDF). Software Configuration Management. Lecture Notes in Computer Science. Vol. 2649. pp. 102–117. doi:10.1007/3-540-39195-9_8. ISBN 978-3-540-14036-8. Archived from the original (PDF) on 2019-04-21.
- ^ Dolstra, Eelco (2006). The Purely Functional Software Deployment Model (PDF) (Ph.D.). Archived from the original (PDF) on 2019-06-09.
- ^ Dolstra, Eelco. "Purely Functional System Configuration Management". www.usenix.org. Retrieved 2024-03-04.
- ^ "Stichting NixOS Foundation". Nixos.org. Retrieved 2015-09-19.
- ^ "NixOS Wiki: History". NixOS Wiki. Retrieved 2024-11-28.
- ^ Garbas, Rok (2015). "Make Nix Friendlier for Beginners". media.ccc.de.
- ^ "NixOS Wiki Archive". Retrieved 2024-01-01.
- ^ Helmich, Tristan. "MediaWiki for NixOS". Retrieved 2024-01-01.
- ^ "NixOS Wiki: History". NixOS Wiki. Retrieved 2024-11-28.
- ^ "Governance". Nixos.org. Archived from the original on 2020-08-16. Retrieved 2020-08-28.
- ^ "Nix RFCS (Request for Comments)". GitHub. 17 December 2021.
- ^ "Release Announcements". Nixos.org. Retrieved 2023-12-09.
- ^ Dolstra, Eelco; Hemel, Armijn (2007-05-07). Purely Functional System Configuration Management (PDF). 11th USENIX workshop on Hot topics in operating systems. San Diego, California, USA: USENIX Association. Archived (PDF) from the original on 2020-07-10. Retrieved 2023-07-19.
- ^ "About NixOS". Nixos.org. Retrieved 2015-09-19.
- ^ van der Burg, Sander; Dolstra, Eelco; de Jonge, Merijn (2008-10-20). Atomic Upgrading of Distributed Systems (PDF). 1st International Workshop on Hot Topics in Software Upgrades. Nashville, Tennessee, USA: Association for Computing Machinery. doi:10.1145/1490283.1490294. ISBN 978-1-60558-304-4. Archived (PDF) from the original on 2021-11-13. Retrieved 2023-07-19.
- ^ NixOS Manual - Rolling Back Configuration Changes, Nixos.org
- ^ Dolstra, Eelco (2005-11-07). Secure Sharing Between Untrusted Users in a Transparent Source/Binary Deployment Model (PDF). 20th IEEE/ACM International Conference on Automated Software Engineering. Long Beach, California, USA: Association for Computing Machinery. doi:10.1145/1101908.1101933. ISBN 978-1-58113-993-8. Archived (PDF) from the original on 2021-11-13. Retrieved 2023-07-19.
- ^ DistroWatch Weekly, Issue 637, 23 November 2015
- ^ Hunt, Adam (28 October 2022). "Review - NixOS" (PDF). Full Circle magazine. Archived (PDF) from the original on 28 October 2022. Retrieved 28 October 2022.
- ^ Proven, Liam. "NixOS 22.11 'Raccoon': Like a proof of concept you can do things with OSes".
- ^ Smith, Jesse. "NixOS 23.11".