This commit is contained in:
Ryan Yin 2024-01-31 21:49:56 +08:00
parent 15c851a575
commit 63913a99f3
3 changed files with 22 additions and 10 deletions

View File

@ -2,6 +2,11 @@
Once you have become familiar with NixOS, you can explore advanced topics and dive deeper into the Nix ecosystem. Here are some resources and community projects that can help you expand your knowledge:
## Community
- [Nix Official - Community](https://nixos.org/community/): Contains information about the Nix community, forums, realtime chat, meetups, RFCs, the official team architecture, etc.
- [Nix Channel Status](https://status.nixos.org/): The build status of each Nix channel.
## Documentation
- [Nix Reference Manual](https://nixos.org/manual/nix/stable/package-management/profiles.html): A comprehensive guide to the Nix package manager, covering its design and usage from the command line.
@ -16,11 +21,9 @@ Once you are comfortable with Flakes, you can explore more advanced techniques a
- [flake-parts](https://github.com/hercules-ci/flake-parts): Simplifies the writing and maintenance of configurations using the Module module system.
- [flake-utils-plus](https://github.com/gytis-ivaskevicius/flake-utils-plus): A third-party package that enhances Flake configuration and provides additional powerful features.
- [digga](https://github.com/divnix/digga): A comprehensive Flake template that combines functionality from various useful Nix toolkits. Note that it has a complex structure and may require some experience to navigate.
There are many other valuable community projects worth exploring. Here are a few examples:
- [nixpak](https://github.com/nixpak/nixpak): A tool to sandbox all sorts of Nix-packaged applications, including graphical ones.
- [nix-output-monitor](https://github.com/maralorn/nix-output-monitor): Beautifully displays the build progress of Nix packages, with additional information such as build time and build log.
- [agenix](https://github.com/ryantm/agenix): A tool for secrets management.
- [colmena](https://github.com/zhaofengli/colmena): Tools for NixOS deployment.
@ -28,6 +31,7 @@ There are many other valuable community projects worth exploring. Here are a few
- [lanzaboote](https://github.com/nix-community/lanzaboote): Enables secure boot for NixOS.
- [impermanence](https://github.com/nix-community/impermanence): Helps make NixOS stateless and improves system reproducibility.
- [devbox](https://github.com/jetpack-io/devbox): Lightweight, repeatable dev environments without container woes, internally powered by nix, similar to earthly.
- [nixpak](https://github.com/nixpak/nixpak): A tool to sandbox all sorts of Nix-packaged applications, including graphical ones.
- [nixpacks](https://github.com/railwayapp/nixpacks): Nixpacks takes a source directory and produces an OCI compliant image that can be deployed anywhere, similar to buildpacks.
- ...

View File

@ -1,5 +1,18 @@
# 进阶玩法 {#advanced-topics}
## 社区
- [Nix 社区官方页](https://nixos.org/community/): 包含官方社区、论坛、RFCs、官方团队的架构以及沟通贡献渠道等信息。
- [Nix Channel Status](https://status.nixos.org/): Nix 各 Channels 的当前的构建状态。
也可以加入中文社区的 NixOS 群组参与讨论:
- Telegram: <https://t.me/nixos_zhcn>
- Matrix: <https://matrix.to/#/#nixos_zhcn:matrix.org>
## 文档
逐渐熟悉 Nix 这一套工具链后,可以进一步读一读 Nix 的三本手册以及其他社区文档,挖掘更多的玩法:
- [Nix Reference Manual](https://nixos.org/manual/nix/stable/package-management/profiles.html): Nix 包管理器使用手册,主要包含 Nix 包管理器的设计、命令行使用说明。
@ -8,16 +21,16 @@
- [nix-pills](https://nixos.org/guides/nix-pills): Nix Pills 对如何使用 Nix 构建软件包进行了深入的阐述,写得比官方文档清晰易懂,而且也足够深入,值得一读。
- [nixos-in-production](https://github.com/Gabriella439/nixos-in-production): 这是一本介绍如何在生产环境中使用 NixOS 的书籍,目前还在编写中,不过已经有了一些很棒的内容。
## 进阶技术与社区项目
在对 Nix Flakes 熟悉到一定程度后,你可以尝试一些 Flakes 的进阶玩法,如下是一些比较流行的社区项目,可以试用:
- [flake-parts](https://github.com/hercules-ci/flake-parts): 通过 Module 模块系统简化配置的编写与维护。
- [flake-utils-plus](https://github.com/gytis-ivaskevicius/flake-utils-plus):同样是用于简化 Flake 配置的第三方包,不过貌似更强大些
- [digga][https://github.com/divnix/digga]: 一个大而全的 Flake 模板,揉合了各种实用 Nix 工具包的功能,不过结构比较复杂,需要一定经验才能玩得转。
- ......
以及其他许多实用的社区项目可探索,我比较关注的有这几个:
- [nixpak](https://github.com/nixpak/nixpak): 一个使用沙箱运行任何 Nix 应用程序的工具(包括 GUI 应用程序),提升系统安全性
- [nix-output-monitor](https://github.com/maralorn/nix-output-monitor): 美化 `nix build` 命令的输出日志,同时打印出更详细的日志信息,以及构建计时器等额外信息,强烈推荐使用!
- [agenix](https://github.com/ryantm/agenix): secrets 管理工具
- [nixos-generator](https://github.com/nix-community/nixos-generators): 镜像生成工具,从 nixos 配置生成 iso/qcow2 等格式的镜像
@ -25,13 +38,10 @@
- [impermanence](https://github.com/nix-community/impermanence): 用于配置无状态系统。可用它持久化你指定的文件或文件夹,同时再将 /home 目录挂载为 tmpfs 或者每次启动时用工具擦除一遍。这样所有不受 impermanence 管理的数据都将成为临时数据,如果它们导致了任何问题,重启下系统这些数据就全部还原到初始状态了!
- [colmena](https://github.com/zhaofengli/colmena): NixOS 主机部署工具
- [devbox](https://github.com/jetpack-io/devbox): 一个基于 Nix 的轻量级开发环境管理工具,类似 earthly目标是统一开发环境与部署环境使得开发环境与部署环境一致
- [nixpak](https://github.com/nixpak/nixpak): 一个使用沙箱运行任何 Nix 应用程序的工具(包括 GUI 应用程序),提升系统安全性
- [nixpacks](https://github.com/railwayapp/nixpacks): 一个将任何代码自动打包为 OCI 容器镜像的工具,类似 buildpacks
- ...
想了解更多内容,可以看看 [awesome-nix](https://github.com/nix-community/awesome-nix).
也可以加入中文社区的NixOS 讨论群参与讨论:
- Telegram: <https://t.me/nixos_zhcn>
- Matrix: <https://matrix.to/#/#nixos_zhcn:matrix.org>

View File

@ -11,8 +11,6 @@ sudo nixos-rebuild switch --flake .#myhost --show-trace -L
## 使用 Git 管理 NixOS 配置 {#git-manage-nixos-config}
> 这里不介绍 Git 本身的使用,如果不熟悉 Git 的话,可以先找资料学习一下 Git.
NixOS 的配置文件是纯文本,因此跟普通的 dotfiles 一样可以使用 Git 管理,这样可以方便的回滚到历史版本,或者在多台机器上同步配置。
> 注意:使用 Git 后,所有未被 Git 跟踪的文件都会被 Nix 忽略,如果发现 Nix 报错说某某文件 not found或许是因为你没 `git add`