NixOS as a desktop/zh: Difference between revisions

Mayer (talk | contribs)
Created page with "* 导入其他模块 * 声明新的选项 * 为选项设定值(这就是你的默认configuration.nix主要做的事情) * 从其他模块引用选项的值(通过传给所有模块的<code>config</code>属性)"
Mayer (talk | contribs)
Created page with "只要你为任何你想在模块之间共享的值声明了选项, 你就可以按照你的喜好, 把你的配置分开放入文件, 这些文件直接地或间接地从你的根文件configuration.nix导入. 你也可以使用<code>builtins.fetchTarball</code>这样的函数从远程源导入模块. 查看wiki页面或者[https://nixos.org/manual/nixos/stable/#sec-writing-modules NixOS手册]来获取更多信息."
Line 44: Line 44:
* 从其他模块引用选项的值(通过传给所有模块的<code>config</code>属性)
* 从其他模块引用选项的值(通过传给所有模块的<code>config</code>属性)


<div lang="en" dir="ltr" class="mw-content-ltr">
只要你为任何你想在模块之间共享的值声明了选项, 你就可以按照你的喜好, 把你的配置分开放入文件, 这些文件直接地或间接地从你的根文件configuration.nix导入. 你也可以使用<code>builtins.fetchTarball</code>这样的函数从远程源导入模块. 查看[[NixOS modules|wiki页面]]或者[https://nixos.org/manual/nixos/stable/#sec-writing-modules NixOS手册]来获取更多信息.
As long as you declare options for any values you want to share between modules, you can divide your configuration however you like into files that get imported, directly or transitively, by your root configuration.nix file. You can also import modules from remote sources, using functions like <code>builtins.fetchTarball</code>. See the [[NixOS modules|wiki page]] or the [https://nixos.org/manual/nixos/stable/#sec-writing-modules NixOS manual] for more information.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">