NixOS
NixOSは、Nixパッケージマネージャーをベースとしたフリー(自由)かつオープンソースのLinuxディストリビューションである。NixOS のアップグレードはアトミックに行われ[4] 、宣言的にに環境構築を行えるシステムにより高い再現性と移植性を担保している。[5]
![]() | |
開発者 |
NixOS contributors NixOS Foundation[1][2] |
---|---|
プログラミング言語 | Nix言語[note 1] |
OSの系統 | Linux (Unix-like) |
開発状況 | 継続中 |
ソースモデル | オープンソース |
初版 | 0.1 / 2003年3日 |
最新安定版 | 25.05 / 23 May 2025年 |
リポジトリ | |
対象市場 | 汎用 |
パッケージ管理 | Nix |
プラットフォーム | i686, x86-64, AArch64 |
カーネル種別 | モノリシック Linuxカーネル |
ライセンス | MIT[3][note 2] |
ウェブサイト |
nixos |
NixOSはNixパッケージマネージャーを通じてNixPkgsを主とした複数のパッケージリポジトリにあるパッケージを利用する。パッケージ構成および設定は特別に設計された遅延評価を行う関数型プログラミング言語であるNix言語を通じて定義される。
2003年、Nix はEelco Dolstra氏率いる研究プロジェクトとして立ち上げられた。信頼性の高いデプロイ手段の探求を目的としたこの研究はDolstra氏の博士論文 T he Purely Functional Software Deployment Model に結実し、宣言的かつ純粋関数的に行う、全く新しいソフトウェア構成へのアプローチを提示した。ユトレヒト大学のEelco Visser氏により監修された彼の研究は、Nixの理論的基礎を築いた[6]。
2006年、Armijn Hemel氏はNixの思想をLinuxディストリビューションに統合する試みを同氏の修士論文として提出し、NixOSのプロトタイプ実装を併せて公開した。[7]
2015年、NixOSとそのエコシステムの開発への継続的な支援、ならびに純粋関数的なソフトウェアデプロイモデルを実装するプロジェクトを支援する目的で NixOS Foundation がオランダにて設立された。[8]
Wikiの沿革
コミュニティによる最初の NixOS wiki は2010年から2011年頃に立ち上げられた。ドキュメントの一元化と知見の共有を目標として掲げていたが、wikiの維持に対するコミュニティの関心が減っていくにつれて古く不正確な情報が多くを占めていった。
2015年11月、Rok Garbas氏は彼のトーク番組である Make Nix Friendlier for Beginners にてwikiの頽廃した現状を指摘し、コミュニティに大きな議論の波を引き起こした。多くの開発者がNix*のマニュアルが公式ドキュメントのためのより良いリポジトリであると主張する一方で[9]
2016年中旬、モデレーション不足によってwikiはスパムボットで溢れかえり、同年8月の編集ロックダウンにつながった。ロックダウン解除を議論するためにGitHub issueが2017年2月に開かれたが、論争は解決策をもたらさないまま終了した。最終的に、2017年5月にてwikiは恆久的に運用停止することとなり、Archive.orgに内容がアーカイブとして保存された。[10]
wikiの不在という状況を改善するため、Jörg Thalheim (Mic92) 氏は2017年4月、nixos-users wiki をGitHub上に立ち上げた。GitHub wikiプラットフォームは迅速な編集が可能な一方で、目次や検索機能などの基本的な機能に欠けていた。直後、Tristan Helmich (fadenb) 氏はGitHub wikiのユーザー体験の低さを理由に、新しくMediaWikiベースのwikiを立ち上げた。Felix Richter (makefu) 氏がの内容をfadenb氏のプラットフォームに移行し、[11]
2024年1月、新たに公式wikiを立ち上げるための取り組みが開始され、現在使用されているwikiインスタンスが誕生した。この「復活」は、NixOSユーザーのために正確かつ統一されたされたドキュメントを維持するというコミュニティの尽力を反映した結果とされた。[12]
バージョン歴史
Name | Date |
---|---|
NixOS 13.10 "Aardvark" | 2013年10月 |
NixOS 14.04 "Baboon" | 2014年4月 |
NixOS 14.12 "Caterpillar" | 2014年12月 |
NixOS 15.09 "Dingo" | 2015年9月 |
NixOS 16.03 "Emu" | 2016年3月 |
NixOS 16.09 "Flounder" | 2016年9月 |
NixOS 17.03 "Gorilla" | 2017年3月 |
NixOS 17.09 "Hummingbird" | 2017年9月 |
NixOS 18.03 "Impala" | 2018年3月 |
NixOS 18.09 "Jellyfish" | 2018年9月 |
NixOS 19.03 "Koi" | 2019年3月 |
NixOS 19.09 "Loris" | 2019年9月 |
NixOS 20.03 "Markhor" | 2020年3月 |
NixOS 20.09 "Nightingale" | 2020年9月 |
NixOS 21.05 "Okapi" | 2021年5月 |
NixOS 21.11 "Porcupine" | 2021年11月 |
NixOS 22.05 "Quokka" | 2022年5月 |
NixOS 22.11 "Raccoon" | 2022年11月 |
NixOS 23.05 "Stoat" | 2023年5月 |
NixOS 23.11 "Tapir" | 2023年11月 |
NixOS 24.05 "Uakari" | 2024年5月 |
NixOS 24.11 "Vicuna" | 2024年11月 |
NixOS 25.05 "Warbler" | 2025年5月 |
機能
宣言的な構成
NixOSでは、カーネルからアプリケーション、システムパッケージ、設定ファイルまでをも含むオペレーティングシステム全体が、Nix言語で書かれた記述に基づいてNixパッケージマネージャーによって構成される。新しいバージョンの構成は古いバージョンの上書きを伴わない。[16]
NixOSのシステムは、グローバルな設定ファイル(通常/etc/nixos
に存在する)に、 ユーザー自身が望む機能の仕様を記述することで設定される。下記はSSHデーモンを実行するミニマルなマシンの設定である。[17]
{
boot.loader.grub.device = "/dev/sda";
fileSystems."/".device = "/dev/sda1";
services.sshd.enable = true;
}
設定ファイルを変更した後、nixos-rebuild
コマンドを使用してシステム構成を(設定ファイルに基づいて)更新できる。このコマンドは、パッケージのダウンロードとインストール、追加の設定ファイルの生成など、新しいバージョンのシステムを作成するために必要なすべての操作を自動的に行う。
アトミックで信頼性の高いアップデート
Nix言語の純粋関数的な特性により、システム上にすでにどのようなパッケージやファイルがあろうと、設定ファイルを評価すれば常に同じ結果が得られる。
NixOSはシステム構成の管理にトランザクション的なアプローチを取っており、アップグレードなどの構成変更をアトミックに行う。例えシステム構成の更新が停電などによって中断されたとしても、システムは変更する前、もしくは完全に更新された状態を一貫に保つ。[18]
Rollbacks
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.[19]
Reproducible system configurations
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
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.[20]
Consistency
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
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).[要説明][<span title="Substituter hasn't been defined here. (July 2023)">clarification needed</span>] Without those parameters, paths can only be substituted from a substituter trusted by the system, or a local sandboxed build which is implicitly trusted.
実装
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.
反響
Jesse Smith, reviewing NixOS 15.09 for DistroWatch Weekly in 2015, 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.[21]
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.[22]
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.[23]
Notes
- ^ 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)
引用エラー: <references>
グループ「note」で定義されている、nameが「other licenses」の <ref>
タグに内容がありません。
引用エラー: <references>
グループ「note」で定義されている、nameが「other programming languages」の <ref>
タグに内容がありません。
See also
- GNU Guix System – an operating system built on GNU Guix that is inspired by Nix
References
- ^ “Community - nixos.org”. 2022年9月23日時点のオリジナルよりアーカイブ。2022年9月23日閲覧。
- ^ “NixOS/nixos-foundation - Github”. GitHub. 2022年9月23日時点のオリジナルよりアーカイブ。2022年9月23日閲覧。
- ^ “nixpkgs/COPYING at master · NixOS/nixpkgs · GitHub”. Github.com. 2015年9月19日閲覧。
- ^ “What Is an Immutable Linux Distro, and Should You Use One?”. HowToGeek.com (2023年12月6日). 2023年12月7日時点のオリジナルよりアーカイブ。2023年12月7日閲覧。
- ^ “DistroWatch.com: NixOS”. Distrowatch.com. 2015年9月19日閲覧。
- ^ Dolstra, Eelco (2003). “Integrating Software Construction and Software Deployment”. Software Configuration Management. Lecture Notes in Computer Science. 2649. pp. 102–117. doi:10.1007/3-540-39195-9_8. ISBN 978-3-540-14036-8. オリジナルの2019-04-21時点におけるアーカイブ。
- ^ Dolstra. “Purely Functional System Configuration Management”. www.usenix.org. 2024年3月4日閲覧。
- ^ “Stichting NixOS Foundation”. Nixos.org. 2015年9月19日閲覧。
- ^ Garbas (2015年). “Make Nix Friendlier for Beginners”. media.ccc.de. Template:Cite webの呼び出しエラー:引数 accessdate は必須です。
- ^ “NixOS Wiki Archive”. 2024年1月1日閲覧。
- ^ Helmich. “MediaWiki for NixOS”. 2024年1月1日閲覧。
- ^ “NixOS Wiki: History”. NixOS Wiki. 2024年11月28日閲覧。
- ^ “Governance”. Nixos.org. 2020年8月16日時点のオリジナルよりアーカイブ。2020年8月28日閲覧。
- ^ “Nix RFCS (Request for Comments)”. GitHub (2021年12月17日). Template:Cite webの呼び出しエラー:引数 accessdate は必須です。
- ^ “Release Announcements”. Nixos.org. 2023年12月9日閲覧。
- ^ Dolstra, Eelco; Hemel, Armijn (7 May 2007). Purely Functional System Configuration Management (PDF). 11th USENIX workshop on Hot topics in operating systems. San Diego, California, USA: USENIX Association. 2020年7月10日時点のオリジナル (PDF)よりアーカイブ. 2023年7月19日閲覧.
- ^ “About NixOS”. Nixos.org. 2015年9月19日閲覧。
- ^ van der Burg, Sander; Dolstra, Eelco; de Jonge, Merijn (20 October 2008). 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. 2021年11月13日時点のオリジナル (PDF)よりアーカイブ. 2023年7月19日閲覧.
- ^ NixOS Manual - Rolling Back Configuration Changes, Nixos.org
- ^ Dolstra, Eelco (7 November 2005). 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. 2021年11月13日時点のオリジナル (PDF)よりアーカイブ. 2023年7月19日閲覧.
- ^ Hunt, Adam (2022年10月28日). “Review - NixOS”. Full Circle magazine. 2022年10月28日時点のオリジナルよりアーカイブ。2022年10月28日閲覧。
- ^ Proven, Liam. “NixOS 22.11 'Raccoon': Like a proof of concept you can do things with OSes”. Template:Cite webの呼び出しエラー:引数 accessdate は必須です。
- ^ Smith, Jesse. “NixOS 23.11”. Template:Cite webの呼び出しエラー:引数 accessdate は必須です。
External links
[[Category:2003年のソフトウェア]] [[Category:OSのセキュリティ技術]] [[Category:Linuxディストリビューション]] [[Category:未査読の翻訳があるページ]]