Jump to content

Flakes/zh: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

(newest | oldest) View ( | older 50) (20 | 50 | 100 | 250 | 500)

28 August 2025

  • curprev 19:2619:26, 28 August 2025 Weijia talk contribs 28,748 bytes −54 Created page with "<syntaxhighlight lang="nix"> { description = "带有 devShell 的示例 flake";"
  • curprev 19:2619:26, 28 August 2025 Weijia talk contribs 28,802 bytes −103 Created page with "<code>devShell</code> 是定义在 flake 中由 Nix 提供的开发环境。它允许您声明一个可复用的 Shell 环境,其中将包含开发特定项目所需的工具、库和环境变量。这相当于在 flake 中定义一个 <code>nix-shell</code>。" Tags: Mobile edit Mobile web edit
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 28,905 bytes −18 Created page with "==== 开发环境 Shell ===="
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 28,923 bytes −56 Created page with "<syntaxhighlight lang="console"> $ nix flake show └───packages └───x86_64-linux ├───default: package 'hello-2.12.2' └───hello: package 'hello-2.12.2' </syntaxhighlight>" Tags: Mobile edit Mobile web edit
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 28,979 bytes −33 Created page with "此 flake 生成一个单 Flake 输出 <code>packages</code>。其中,<code>x86_64-linux</code> 是系统特定的属性集。其中包含两个软件包的 Derivations(派生/定义):<code>default</code> 和 <code>hello</code>。您可以使用 {{Nix Manual|name=show 命令|anchor=command-ref/new-cli/nix3-flake-show}} 给出某 flake 的输出,如下所示:"
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,012 bytes −68 Created page with "{{ic|nix flake}} 的子命令在 {{Nix Manual|name=Nix 手册命令参考页面|anchor=command-ref/new-cli/nix3-flake}} 中被描述。"
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,080 bytes −61 Created page with "=== Nix Flakes 命令 === {{Main|Nix (command)}}" Tags: Mobile edit Mobile web edit
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,141 bytes −41 Created page with "因此,如果您使用 <code>git</code> 管理您的 flake,请确保在首次创建之后使用 <code>git add</code>添加所有项目文件。}}"
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,182 bytes −56 Created page with "{{Note | 对于 Git 仓库中的 flakes,只有工作区中的文件才会被复制到 Store 中。" Tags: Mobile edit Mobile web edit
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,238 bytes −45 Created page with "{{Warning | 由于 flake 文件的内容会被复制到全局可读的 Nix Store 目录下,所以请不要在 flake 文件中写入任何未加密的秘密信息。您应该改用 秘密管理方案。}}"
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,283 bytes −30 Created page with "== 用法 =="
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,313 bytes −54 Created page with "添加如下内容至 <code>~/.config/nix/nix.conf</code> 或 <code>/etc/nix/nix.conf</code>:"
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,367 bytes −20 Created page with "====Nix 独立程序===="
  • curprev 19:2519:25, 28 August 2025 Weijia talk contribs 29,387 bytes −54 Created page with "添加如下内容至您的 home manager 配置:" Tags: Mobile edit Mobile web edit
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,441 bytes −56 Created page with "====Home Manager====" Tags: Mobile edit Mobile web edit
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,497 bytes −66 Created page with "添加如下内容至 NixOS 配置:"
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,563 bytes −56 Created page with "==== NixOS ===="
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,619 bytes −17 Created page with "=== 永久启用 Flakes ==="
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,636 bytes −61 Created page with "当使用任意 <code>nix</code> 命令时,添加如下命令行参数:" Tags: Mobile edit Mobile web edit
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,697 bytes −17 Created page with "=== 临时启用 Flakes ==="
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,714 bytes −30 Created page with "== 设置 ==" Tags: Mobile edit Mobile web edit
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,744 bytes −191 Created page with "=== Nix 配置 === 为了推导 flake,您可以覆盖 <code>nix.conf</code> 文件中设置的全局 Nix 配置。例如,这可用于设置特定项目的二进制缓存源,同时保持全局配置不变。Flake 文件中可包含一个 nixConfig 属性,并在其中设置相关配置。例如,启用 nix-community 二进制缓存可以通过以下方式实现: {{File|3=<nowiki>{ ... nixConfig = { extra-substituters = [ "https://nix-community.cach..."
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 29,935 bytes −78 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 输出不使用其输入(尽管这在实践中极不可能)..."
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 30,013 bytes −56 Created page with "packages.x86_64-linux.default = self.packages.x86_64-linux.hello;" Tags: Mobile edit Mobile web edit
  • curprev 19:2419:24, 28 August 2025 Weijia talk contribs 30,069 bytes −56 Created page with "packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;"
  • curprev 19:2319:23, 28 August 2025 Weijia talk contribs 30,125 bytes −56 Created page with "outputs = { self, nixpkgs }: {"
  • curprev 19:2319:23, 28 August 2025 Weijia talk contribs 30,181 bytes −56 Created page with "inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };" Tags: Mobile edit Mobile web edit
  • curprev 19:2319:23, 28 August 2025 Weijia talk contribs 30,237 bytes +7 Created page with "== Flake 文件结构 == 一个最小化的 flake 文件包含该 flake 的描述(description),一组输入依赖项(inputs)和一个输出(outputs)。您可以随时使用 <code>nix flake init</code> 命令来生成一个非常基础的 flake 文件。这将在当前目录下创建一个名为 <code>flake.nix</code> 的文件,其内容类似于: {{File|3=<nowiki>{ description = "一个非常基础的 flake";"
  • curprev 19:2319:23, 28 August 2025 Weijia talk contribs 30,230 bytes −52 Created page with "Flakes 还允许锁定引用和版本,然后通过 inputs {{cite manual|nix|command-ref/new-cli/nix3-flake-lock|number=7.5.19|title=nix flake lock}}{{cite manual|nix|command-ref/new-cli/nix3-flake-info|number=7.5.17|title=nix flake info}} 以可编程方式进行查询和更新。此外,一个实验性的 CLI 实用程序接受 flake 引用作为参数,该引用指向用于构建、运行和部署软件包的表达式。{{Cite manual|nix|command-ref/new-cli/nix|num..." Tags: Mobile edit Mobile web edit
  • curprev 19:2319:23, 28 August 2025 Weijia talk contribs 30,282 bytes −96 Created page with "Flake 是一个直接包含 <code>flake.nix</code> 文件的目录,该文件内容遵循一种特定结构。Flakes 引入了一种类似 URL 的语法{{Cite manual|nix|command-ref/new-cli/nix3-flake|number=8.5.17|title=nix flake|subsection=url-like-syntax|subtitle=URL-like syntax}} 来指定远程资源。为了简化这种 URL 语法,Flakes 使用符号标识符注册表{{Cite manual|nix|command-ref/new-cli/nix3-registry|number=8.5.62|title=nix registry}},这允..."
  • curprev 19:2219:22, 28 August 2025 Weijia talk contribs 30,378 bytes −105 Created page with "'''Nix Flakes''' 是 Nix 2.4 版本中首次引入的一项实验性功能{{Cite manual|nix|development/experimental-features|number=13.8|title=Experimental Features|subsection=xp-feature-flakes|subtitle=flakes}}{{Cite manual|nix|release-notes/rl-2.4|number=14.27|title=Release 2.4 (2021-11-01)}},旨在解决 Nix 生态系统许多领域的改进问题:它们为 Nix 项目提供了一个统一结构、允许固定每个依赖项的特..."
  • curprev 19:2219:22, 28 August 2025 Weijia talk contribs 30,483 bytes +30,483 Created page with "{{Cleanup}}"
(newest | oldest) View ( | older 50) (20 | 50 | 100 | 250 | 500)