Translations:Flakes/190/zh

Revision as of 19:24, 28 August 2025 by Weijia (talk | contribs) (Created page with "}; }</nowiki>|name=flake.nix|lang=nix}} 在上述示例中,您可以看到对该 flake 的'''描述'''、指定为某 Github 仓库特定分支的'''输入'''(此为 <code>nixos/nixpkgs</code> 仓库的 <code>nixos-unstable</code> 分支)以及一个使用该输入的'''输出'''。该输出简单地指定了该 flake 包含一个用于 x86_64 架构名为 <code>hello</code> 的包。即使您的 flake 输出不使用其输入(尽管这在实践中极不可能)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

}; }</nowiki>|name=flake.nix|lang=nix}}

在上述示例中,您可以看到對該 flake 的描述、指定為某 Github 倉庫特定分支的輸入(此為 nixos/nixpkgs 倉庫的 nixos-unstable 分支)以及一個使用該輸入的輸出。該輸出簡單地指定了該 flake 包含一個用於 x86_64 架構名為 hello 的包。即使您的 flake 輸出不使用其輸入(儘管這在實踐中極不可能),其輸出仍需要是一個 Nix 函數。

Note: Flakes require you to specify its outputs for each architecture separately. For more information, read the related section below.