mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-23 12:43:08 +00:00
fix: link
This commit is contained in:
parent
7361d07e72
commit
7dbaf87908
2 changed files with 4 additions and 4 deletions
|
@ -120,7 +120,7 @@ The lower the `priority` value, the higher the actual priority. As a result, `li
|
|||
|
||||
Using these functions can be very helpful for modularizing the configuration. You can set default values in a low-level module (base module) and force values in a high-level module.
|
||||
|
||||
For example, in my configuration at [ryan4yin/nix-config/blob/main/modules/nixos/core-server.nix#L30](https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/core-server.nix#L30), I define default values like this:
|
||||
For example, in my configuration at [ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-server.nix](https://github.com/ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-server.nix#L32), I define default values like this:
|
||||
|
||||
```nix{6}
|
||||
{ lib, pkgs, ... }:
|
||||
|
@ -134,7 +134,7 @@ For example, in my configuration at [ryan4yin/nix-config/blob/main/modules/nixos
|
|||
}
|
||||
```
|
||||
|
||||
Then, for my desktop machine, I override the value in [ryan4yin/nix-config/blob/main/modules/nixos/core-desktop.nix#L15](https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/core-desktop.nix#L15) like this:
|
||||
Then, for my desktop machine, I override the value in [ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-desktop.nix](https://github.com/ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-desktop.nix#L18) like this:
|
||||
|
||||
```nix{10}
|
||||
{ lib, pkgs, ... }:
|
||||
|
|
|
@ -126,7 +126,7 @@ Nix Flakes 对目录结构没有任何要求,你可以参考上面的例子,
|
|||
|
||||
这几个函数在模块化 NixOS 配置中非常有用,因为你可以在低层级的模块(base module)中设置默认值,然后在高层级的模块(high-level module)中设置优先级更高的值。
|
||||
|
||||
举个例子,我在这里定义了一个默认值:<https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/core-server.nix#L30>
|
||||
举个例子,我在这里定义了一个默认值:<https://github.com/ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-server.nix#L32>
|
||||
|
||||
```nix{6}
|
||||
{ lib, pkgs, ... }:
|
||||
|
@ -140,7 +140,7 @@ Nix Flakes 对目录结构没有任何要求,你可以参考上面的例子,
|
|||
}
|
||||
```
|
||||
|
||||
然后在桌面机器的配置中,我强制覆盖了默认值: <https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/core-desktop.nix#L15>
|
||||
然后在桌面机器的配置中,我强制覆盖了默认值: <https://github.com/ryan4yin/nix-config/blob/c515ea9/modules/nixos/core-desktop.nix#L18>
|
||||
|
||||
```nix{10}
|
||||
{ lib, pkgs, ... }:
|
||||
|
|
Loading…
Reference in a new issue