Flakes/zh: Difference between revisions

Weijia (talk | contribs)
Created page with "==== 在 flake 仓库中构建特定属性 ===="
Weijia (talk | contribs)
Created page with "运行 <code>nix build</code> 将在 <code>legacyPackages</code> 和 <code>packages</code> 输出属性中查找相应的 derivation,然后基于您的系统架构构建默认输出项。如果您想在 flake 仓库中指定构建属性,可以运行 <code>nix build .#<attr></code>。在上面的示例中,如果您想构建 <code>packages.x86_64-linux.hello</code> 属性,请运行:"
Line 147: Line 147:
==== 在 flake 仓库中构建特定属性 ====
==== 在 flake 仓库中构建特定属性 ====


<div lang="en" dir="ltr" class="mw-content-ltr">
运行 <code>nix build</code> 将在 <code>legacyPackages</code> <code>packages</code> 输出属性中查找相应的 [[derivation|derivation]],然后基于您的系统架构构建默认输出项。如果您想在 flake 仓库中指定构建属性,可以运行 <code>nix build .#<attr></code>。在上面的示例中,如果您想构建 <code>packages.x86_64-linux.hello</code> 属性,请运行:
Running <code>nix build</code> will look in the <code>legacyPackages</code> and <code>packages</code> output attributes for the corresponding [[derivation]] and then your system architecture and build the default output. If you want to specify a build attribute in a flake repository, you can run <code>nix build .#<attr></code>. In the example above, if you wanted to build the <code>packages.x86_64-linux.hello</code> attribute, run:
</div>


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