mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-22 20:23:10 +00:00
[Little Change]: 重写了模块系统关于省略 config
key 的说明 (#159)
* [Little Change]:重写关于省略 `config` 的声明 * [Little Change]:rewrite about "emit declaration of `config`"
This commit is contained in:
parent
b38976ad9d
commit
3b322cd852
2 changed files with 5 additions and 6 deletions
|
@ -202,9 +202,9 @@ for `foo` by setting the `options` defined here. For example:
|
||||||
```
|
```
|
||||||
|
|
||||||
In the example above, the way we assign values to `options` is actually a kind of
|
In the example above, the way we assign values to `options` is actually a kind of
|
||||||
**abbreviation**. When a module declares only `options` without `config` (and other
|
**abbreviation**. When a module only contains `config` without any other delcaration (like `option` and other
|
||||||
special parameters of the module system), we can omit the `config` prefix and directly use
|
special parameters of the module system), we can omit the `config` wrapping , just directly write the
|
||||||
the name of `options` for assignment.
|
content of `config` to assign value to `option` section declared in other modules!
|
||||||
|
|
||||||
## Assignment and Lazy Evaluation in the Module System
|
## Assignment and Lazy Evaluation in the Module System
|
||||||
|
|
||||||
|
|
|
@ -183,9 +183,8 @@ foo 的自定义配置了,示例:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
上面这个例子中我们为 `options` 赋值的方式实际上是一种**缩写**,当一个模块中只声明了
|
上面这个例子中我们为 `options` 赋值的方式实际上是一种**缩写**,当一个模块中只包含定义(`config`),而没有声明(`option`,并且没有其他特殊参数)时,我们可以省略掉 `config`
|
||||||
`options`,而没有声明 `config` (以及其他模块系统的特殊参数)时,我们可以省略掉 `config`
|
包装,直接书写 `config` 部分来对其他模块中已声明的 `option` 赋值。
|
||||||
前缀,直接使用 `options` 的名称进行赋值。
|
|
||||||
|
|
||||||
## 模块系统的赋值与延迟求值 {#module-system-assignment-and-lazy-evaluation}
|
## 模块系统的赋值与延迟求值 {#module-system-assignment-and-lazy-evaluation}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue