This commit is contained in:
Ryan Yin 2024-02-15 16:28:24 +08:00
parent 9abb024ae4
commit 17a3f49e30
2 changed files with 2 additions and 2 deletions

View File

@ -252,7 +252,7 @@ The definition is actually a Nix function, and it has five **automatically gener
1. `lib`: A built-in function library included with nixpkgs, offering many practical functions for operating Nix expressions.
- For more information, see <https://nixos.org/manual/nixpkgs/stable/#id-1.4>.
2. `config`: A set of all config values in the current environment, which may sometimes be used.
2. `config`: A set of all options' values in the current environment, which will be used extensively in the subsequent section on the module system.
3. `options`: A set of all options defined in all Modules in the current environment.
4. `pkgs`: A collection containing all nixpkgs packages, along with several related utility functions.
- At the beginner stage, you can consider its default value to be `nixpkgs.legacyPackages."${system}"`, and the value of `nixpkgs.pkgs` can be customized through the `nixpkgs.pkgs` option.

View File

@ -249,7 +249,7 @@ sudo nixos-rebuild switch --flake github:owner/repo#your-hostname
1. `lib`: **nixpkgs 自带的函数库,提供了许多操作 Nix 表达式的实用函数**
- 详见 <https://nixos.org/manual/nixpkgs/stable/#id-1.4>
2. `config`: 当前环境中所有 config 值的集合,有时候会用到
2. `config`: 包含了当前环境中所有 option 的值,在后面学习模块系统时会大量使用它
3. `options`: 当前环境中所有 Modules 中定义的所有 options 的集合
4. `pkgs`: **一个包含所有 nixpkgs 包的集合,它也提供了许多相关的工具函数**
- 入门阶段可以认为它的默认值为 `nixpkgs.legacyPackages."${system}"`,可通过 `nixpkgs.pkgs` 这个 option 来自定义 pkgs 的值