Flakes/zh: Difference between revisions
Created page with "在此示例中,输入将指向 nixpkgs-unstable 频道(channel)。" |
Updating to match new version of source page |
||
| (One intermediate revision by one other user not shown) | |||
| Line 17: | Line 17: | ||
description = "A very basic flake"; | description = "A very basic flake"; | ||
inputs = { | inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | ||
}; | }; | ||
outputs = { self, nixpkgs }: { | outputs = { self, nixpkgs }: { | ||
packages.x86_64-linux = { | |||
packages.x86_64-linux | default = self.packages.x86_64-linux.hello; | ||
hello = nixpkgs.legacyPackages.x86_64-linux.hello; | |||
}; | |||
}; | }; | ||
}</nowiki>|name=flake.nix|lang=nix}} | }</nowiki>|name=flake.nix|lang=nix}} | ||
| Line 201: | Line 200: | ||
<code>inputs.nixpkgs.url = "<nowiki>https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz</nowiki>";</code> | <code>inputs.nixpkgs.url = "<nowiki>https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz</nowiki>";</code> | ||
在此示例中,输入将指向 nixpkgs-unstable 频道(channel)。 | 在此示例中,输入将指向 <code>nixpkgs-unstable</code> 频道(channel)。 | ||
对于任何包含 flake.nix 文件的仓库,其所属网站也必须被定义。Nix 知道 nixpkgs 仓库的位置,因此没有必要声明它在 GitHub 上。 | 对于任何包含 flake.nix 文件的仓库,其所属网站也必须被定义。Nix 知道 nixpkgs 仓库的位置,因此没有必要声明它在 GitHub 上。 | ||