Flakes/zh: Difference between revisions
Created page with "outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems); in { packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in { hello = pkgs.hello; default = pkgs.hello; }); }; } </syntaxhighlight>" |
Created page with "您还可以使用如 flake-utils 或 flake-parts 的第三方项目来编写,它们会提供代码来避免此类样板代码。为了避免多次重新定义程序,请参阅 Flake Utils#Defining a flake for multiple architectures" Tags: Mobile edit Mobile web edit |
||
Line 331: | Line 331: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
您还可以使用如 [[Flake Utils|flake-utils]] 或 [[Flake Parts|flake-parts]] 的第三方项目来编写,它们会提供代码来避免此类样板代码。为了避免多次重新定义程序,请参阅 [[Flake Utils#Defining a flake for multiple architectures]] | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> |