在nix语言快速入门前面添加集合的基础知识#46
Merged
ryan4yin merged 4 commits intoNixOS-CN:mainfrom Sep 18, 2025
clsty:patch-1
Merged
Conversation
Added examples of collections in Nix syntax, demonstrating how to define collections and nested attributes.
Contributor
Author
|
好吧,刚才我看到下面有这样一段:
(真的很想吐槽:哪里方便了?还没到这里就已经结束了,我谢谢您嘞~) 话虽如此,此 PR 我认为还是有必要的,只是内容可以更精简一些,直接提示读者即可。 |
ryan4yin
approved these changes
Sep 18, 2025
Member
|
我看了下,确实这个语言教程前面的 即时计算被直接依赖的值、文件求值、以及后面对词法、句法、语法的详细说明,对单纯的「Nix 语言入门」而言都显得不是很有必要,有点分散了注意力,你的修改很有必要,感谢贡献! 另外这份文档很久没人动过了,你如果有兴趣的话可以试试对它做一次大修,我帮你 review. |
Member
|
顺便我就是 NixOS & Flakes Book 的作者,其实之前我也写过一份很简单的 Nix 语言入门教程,但是有人反馈说对新手不太友好,而且我确实也写得比较简略,所以后面才改成推荐阅读这一份。 |
Contributor
Author
可以的,我向来对这种事感兴趣,可以边学边做。预计两周内能够完成。
我知道的,谢谢你写的指南,能在这里看到你我也感到惊喜与荣幸。 |
This was referenced Sep 19, 2025
Merged
Merged
Merged
8 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
作用
让 Nix 新手更容易理解这份教程。
背景
我第一次尝试学习 Nix 时使用的资料是 NixOS & Flakes Book,其中Nix 语言入门提到:
打开这个页面后,交互模式还好,但是当我读到下面这句
我完全无法理解:匿名集合在这里指的是什么?a 集合又指的是什么?
即使我打算暂时放下问题,读读接下来的段落,或许就能理解前面的问题了,但完全不行,疑惑甚至越来越多了。
以上所述的入门失败大概已经是一年前的事了。
前不久我打算再次挑战 Nix 入门,这次我选择的教程是 Evertras/simple-homemanager,并且顺利地阅读到了结尾。只不过,它的内容深度有限,稍微深入的内容还是需要其它资源。
于是我再次想起了《Nix 语言快速入门》,而这次我终于能理解它在说什么了,并且也明白了对于真正的 Nix 新手来说,它所缺少的基础知识是什么,于是就有了这个 PR。