Flakes 仍是实验性特性,稳定化过程中可能引入破坏性变更;本书为个人观点教程,作者自述使用 NixOS 不足 9 个月,内容可能存在误解或不恰当示例;macOS 用户需另行参考 nix-darwin-kickstarter 项目起步

nixos-and-flakes-book
ryan4yinCC-BY-SA-4.0活跃维护一份面向新手的中文 NixOS 与 Flakes 教程,手把手教你用声明式配置管理 Linux 系统,从入门到能自己写配置。
:hammer_and_wrench: :heart: Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place! 想要学习使用 NixOS 与 Flakes 吗?在寻找一份新手友好的教程?那你可来对地方了!
面向新手的 NixOS 与 Flakes 中文教程书,帮你从零理解并上手 Nix 配置管理
一份面向新手的中文 NixOS 与 Flakes 教程,手把手教你用声明式配置管理 Linux 系统,从入门到能自己写配置。
核心能力
- 以 Flakes 为主线讲解 NixOS 配置管理
- 提供中英双语在线阅读版本
- 社区维护葡语、日语、西语译本
- 用 GitHub Discussions 收集反馈并持续修订
- 附 macOS 用户的 nix-darwin 起步项目指引
容易踩的坑
- v0.9.1最新正式版2026-10-07 · 2026-10-07 06:45 UTC
5b36e47 fix(export): strip the language prefix from localized sidebar links (#303)
What's Changed
- fix(docs): pin remaining nixos-23.05 links to nixos-26.05 by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/297
- fix(docs): technical correctness sweep (mc syntax, fence languages, tabs, links) by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/298
- fix(docs): EN/ZH parity and zh terminology cleanup by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/299
- docs(en): fix translation errors and align wording with zh by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/300
- chore: repository hygiene and per-page SEO descriptions by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/301
- fix(seo): strip inline style/script before deriving descriptions by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/302
- fix(export): strip language prefix from localized sidebar links by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/303
Full Changelog: https://github.com/ryan4yin/nixos-and-flakes-book/compare/v0.9.0...v0.9.1
- v0.9.02026-10-03 · 2026-10-03 15:31 UTC
查看更新说明
a4d0480 fix: export footnote/link collisions and VitePress config cleanup (#296)
What's Changed
- chore(deps): refresh flake.lock and npm dependencies by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/294
- feat(pdf): export PDF via pandoc + typst by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/295
- fix: export footnote/link collisions and VitePress config cleanup by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/296
Full Changelog: https://github.com/ryan4yin/nixos-and-flakes-book/compare/v0.8.2...v0.9.0
- v0.8.22026-10-03 · 2026-10-03 13:40 UTC
查看更新说明
9cc31af docs: fix issues reported in discussions and invalid code blocks (#293)
What's Changed
- docs: simplify flake url with pull request by @minhtrancccp in https://github.com/ryan4yin/nixos-and-flakes-book/pull/273
- Outdated package for pnpm by @Phobos-Tau in https://github.com/ryan4yin/nixos-and-flakes-book/pull/277
- chore: upgrade nixos 25.11 → 26.05, add AGENTS.md by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/279
- feat: add Spanish community-maintained translation to README / picker by @vorosdev in https://github.com/ryan4yin/nixos-and-flakes-book/pull/280
- docs: fix module system cross-reference by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/286
- fix(ci): restore PDF release with pnpm 11 by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/287
- docs(en): pkg source viewing: nix repl :e → nix edit by @Drazape in https://github.com/ryan4yin/nixos-and-flakes-book/pull/288
- docs: fix and refresh the Python section by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/291
- docs: refresh outdated project links and descriptions by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/292
- docs: fix home-manager example, flake links, placeholders, and Nix syntax errors by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/293
New Contributors
- @minhtrancccp made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/273
- @Phobos-Tau made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/277
- @vorosdev made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/280
- @Drazape made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/288
Full Changelog: https://github.com/ryan4yin/nixos-and-flakes-book/compare/v0.7.0...v0.8.2
- v0.8.12026-08-05 · 2026-08-05 03:36 UTC
查看更新说明
c3e08f1 chore(deps): update packages and pin pnpm 11
What's Changed
- docs: simplify flake url with pull request by @minhtrancccp in https://github.com/ryan4yin/nixos-and-flakes-book/pull/273
- Outdated package for pnpm by @Phobos-Tau in https://github.com/ryan4yin/nixos-and-flakes-book/pull/277
- chore: upgrade nixos 25.11 → 26.05, add AGENTS.md by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/279
- feat: add Spanish community-maintained translation to README / picker by @vorosdev in https://github.com/ryan4yin/nixos-and-flakes-book/pull/280
- docs: fix module system cross-reference by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/286
New Contributors
- @minhtrancccp made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/273
- @Phobos-Tau made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/277
- @vorosdev made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/280
Full Changelog: https://github.com/ryan4yin/nixos-and-flakes-book/compare/v0.7.0...v0.8.1
- v0.7.02026-02-11 · 2026-02-11 05:43 UTC
查看更新说明
0c9811b docs update: crosscompile option nixpkgs.localSystem.system -> nixpkgs.buildPlatform.system (#275)
What's Changed
- Fix misleading comments about
home.filelinking behavior by @Sunrongguo2008 in https://github.com/ryan4yin/nixos-and-flakes-book/pull/268 - fix: broken link to Home Manager Option Search by @resset in https://github.com/ryan4yin/nixos-and-flakes-book/pull/270
- fix(zh - nixos-flake-and-module-system): translation -> internal link by @YaoSiQian in https://github.com/ryan4yin/nixos-and-flakes-book/pull/271
- fix: links by @ryan4yin in https://github.com/ryan4yin/nixos-and-flakes-book/pull/272
- docs update: cross compiling option nixpkgs.localSystem.system -> nixpkgs.buildPlatform.system by @squirl42 in https://github.com/ryan4yin/nixos-and-flakes-book/pull/275
New Contributors
- @resset made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/270
- @YaoSiQian made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/271
- @squirl42 made their first contribution in https://github.com/ryan4yin/nixos-and-flakes-book/pull/275
Full Changelog: https://github.com/ryan4yin/nixos-and-flakes-book/compare/v0.6.1...v0.7.0
- Fix misleading comments about
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。

NixOS & Flakes Book :hammer_and_wrench: :heart:
Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place!
An unofficial and opinionated NixOS & Flakes :book: for beginners: https://nixos-and-flakes.thiscute.world/
Author-Maintained Versions:
- English Version: https://nixos-and-flakes.thiscute.world/
- 中文版: https://nixos-and-flakes.thiscute.world/zh/
Community-Maintained Versions:
- Versão em Português: https://nixos-and-flakes.ieda.me/
- 日本語版: https://nixos-and-flakes-ja.hayao0819.com/
- Versión en Español: https://nixos-and-flakes.voros.xyz/
If you're using macOS, ryan4yin/nix-darwin-kickstarter may be a good starting point for you, you can learn how to use Nix with this book and take nix-darwin-kickstarter as a start point to build your own Nix configuration.
Feedback and Discussion
I’m not an expert on NixOS, and I’ve only been using NixOS for less than 9 months as of 2024-02, so there must be some misconceptions or inappropriate examples in the book. If anyone finds anything incorrect or has any questions or suggestions, just let me know by opening an issue or joining the discussion on GitHub Discussions. I'm glad to continue optimizing the content of this book.
The reason why I wrote this little book was only because no one in the community did it for me, who was a beginner at the time, so I chose to do it myself. Even though I knew I could make mistakes, it's much better than do nothing.
My hope is that this book can help more people, enabling them to experience the joys of NixOS. Hope you like it!
Introduction to Flakes
The flakes experimental feature is a major development for Nix, it introduces a policy for managing dependencies between Nix expressions, it improves reproducibility, composability and usability in the Nix ecosystem. Although it's still an experimental feature, flakes have been widely used by the Nix community.1
Flakes is one of the most significant changes the nix project has ever seen.2
A Word of Caution about Flakes
The benefits of Flakes are evident, and the entire NixOS community has embraced it wholeheartedly. Currently, more than half of the users utilize Flakes3, providing assurance that Flakes will not be deprecated.
:warning: However, it's important to note that Flakes is still an experimental feature. Some issues persist, and there is a possibility of introducing breaking changes during the stabilization process. The extent of these breaking changes remains uncertain.
Overall, I strongly recommend everyone to use Flakes, especially since this book revolves around NixOS and Flakes. However, it's crucial to be prepared for potential problems that may arise due to forthcoming breaking changes.
Contribution
A real community, however, exists only when its members interact in a meaningful way that deepens their understanding of each other and leads to learning.
If you find something which doesn't make sense, or something doesn't seem right, please make a pull request and please add valid and well-reasoned explanations about your changes or comments.
Before adding a pull request, please see the contributing guidelines.
Thank you to all the people who already contributed to this project!
References
- The cover is based on the image from anime "The Rolling Girls"
- The NixOS logo is from NixOS
License
NixOS & Flakes Book © 2023 by Ryan Yin is licensed under CC BY-SA 4.0