Main public logs
Appearance
Combined display of all available logs of Official NixOS Wiki. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).
- 19:29, 28 August 2025 Weijia talk contribs created page Translations:Flakes/48/zh (Created page with "您还可以定义其他任意属性,但以上这些是 Nix 已知的输出。")
- 19:29, 28 August 2025 Weijia talk contribs created page Translations:Flakes/154/zh (Created page with "* <code><store-path></code> 是 <code>/nix/store..</code> 的路径。")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/153/zh (Created page with "* <code><flake></code> 是一个 flake 名称, 如“nixpkgs”。")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/152/zh (Created page with "* <code><name></code> 是一个属性名称,如“hello”。")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/45/zh (Created page with "* <code><system></code> 为类似“x86_64-linux”、“aarch64-linux”、“i686-linux”、“x86_64-darwin”的值")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/44/zh (Created page with "其中:")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/43/zh (Created page with "一旦 Inputs 被解析,它们就会与 <code>self</code> 一起传递给函数 <code>outputs</code>,<code>self</code> 是此 flake 在 Store 中的目录。<code>outputs</code> 根据以下规范返回 flake 的输出。")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/42/zh (Created page with "=== 输出规范 ===")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/207/zh (Created page with "<syntaxhighlight lang="nix"> inputs.self.submodules = true; </syntaxhighlight>")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/206/zh (Created page with "默认情况下,包 <code>src</code> 中的 Git 子模块不会被复制到 Nix Store,这可能会导致构建失败。Git 仓库中的 Flakes 可以声明它们需要启用 Git 子模块。从 Nix 版本 [https://discourse.nixos.org/t/nix-2-27-0-released/62003 2.27] 开始,您可以通过以下方式启用子模块:")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/41/zh (Created page with "使用大括号 ({}),我们可以缩短这些内容并将其放在一个表中。代码如下所示:")
- 19:28, 28 August 2025 Weijia talk contribs created page Translations:Flakes/39/zh (Created page with "如果您想让 Hyprland 的 nixpkgs 依赖跟随 nixpkgs 输入以避免出现多个版本的 nixpkgs,可以使用以下代码来完成:")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/37/zh (Created page with "例如,将 Hyprland 添加为输入看起来像这样:")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/36/zh (Created page with "对于任何包含 flake.nix 文件的仓库,其所属网站也必须被定义。Nix 知道 nixpkgs 仓库的位置,因此没有必要声明它在 GitHub 上。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/34/zh (Created page with "Nixpkgs 可使用以下代码进行定义:")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/33/zh (Created page with "<code>inputs</code> 属性定义了 flake 的依赖项。例如,为了让系统能够正确构建,nixpkgs 必须被定义为系统 flake 的依赖项。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/150/zh (Created page with "[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references Nix flake 引用手册].")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/32/zh (Created page with "[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-inputs Nix flake inputs 手册].")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/31/zh (Created page with "=== 输入规范 ===")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/149/zh (Created page with "* <code>nixConfig</code>:一个属性集,包含了 [https://nixos.org/manual/nix/stable/command-ref/conf-file.html 赋予 nix.conf 的值]。这可以通过添加特定于 flake 的配置(例如 二进制缓存源)来扩展用户 nix 操作的正常行为。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/148/zh (Created page with "* <code>outputs</code>: 一个接收参数的函数,其参数为所有所需输入的属性集,并输出另一个属性集,其规范如下所述。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/147/zh (Created page with "* <code>inputs</code>:一个包含此 flake 所有依赖项的属性集。相关规范见下述内容。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/30/zh (Created page with "* <code>description</code>:描述此 flake 的字符串。")
- 19:27, 28 August 2025 Weijia talk contribs created page Translations:Flakes/29/zh (Created page with "它有 4 个顶级属性:")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/28/zh (Created page with "<code>flake.nix</code> 文件是一个具有特殊限制的 Nix 文件(稍后会详细介绍)。")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/27/zh (Created page with "== Flake 规范 ==")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/205/zh (Created page with "同样,您可以给 <code>run</code> 命令:<code>nix run .#hello</code> 和 <code>develop</code>命令:<code>nix develop .#hello</code>指定属性。")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/204/zh (Created page with "<syntaxHighlight lang=console> $ nix build .#hello </syntaxHighlight>")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/103/zh (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> 属性,请运行:")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/102/zh (Created page with "==== 在 flake 仓库中构建特定属性 ====")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/203/zh (Created page with "{{note|使用 nix develop 命令进入开发 shell 无需定义 devShell。 如果未定义 devShell,nix develop 命令会将您带入一个包含 flake 默认构建依赖项(如果有)的环境。}}")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/202/zh (Created page with "<syntaxhighlight lang="console"> $ nix develop </syntaxhighlight>")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/201/zh (Created page with "进入开发环境 Shell:")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/200/zh (Created page with "outputs = { self, nixpkgs}: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; in { devShells.x86_64-linux.default = pkgs.mkShell { buildInputs = with pkgs; [ hello ]; shellHook = '' echo "欢迎进入 devShell!" ''; }; }; } </syntaxhighlight>")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/199/zh (Created page with "inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/198/zh (Created page with "<syntaxhighlight lang="nix"> { description = "带有 devShell 的示例 flake";")
- 19:26, 28 August 2025 Weijia talk contribs created page Translations:Flakes/197/zh (Created page with "<code>devShell</code> 是定义在 flake 中由 Nix 提供的开发环境。它允许您声明一个可复用的 Shell 环境,其中将包含开发特定项目所需的工具、库和环境变量。这相当于在 flake 中定义一个 <code>nix-shell</code>。")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/196/zh (Created page with "==== 开发环境 Shell ====")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/195/zh (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>")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/194/zh (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 的输出,如下所示:")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/65/zh (Created page with "{{ic|nix flake}} 的子命令在 {{Nix Manual|name=Nix 手册命令参考页面|anchor=command-ref/new-cli/nix3-flake}} 中被描述。")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/64/zh (Created page with "=== Nix Flakes 命令 === {{Main|Nix (command)}}")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/22/zh (Created page with "因此,如果您使用 <code>git</code> 管理您的 flake,请确保在首次创建之后使用 <code>git add</code>添加所有项目文件。}}")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/146/zh (Created page with "{{Note | 对于 Git 仓库中的 flakes,只有工作区中的文件才会被复制到 Store 中。")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/20/zh (Created page with "{{Warning | 由于 flake 文件的内容会被复制到全局可读的 Nix Store 目录下,所以请不要在 flake 文件中写入任何未加密的秘密信息。您应该改用 秘密管理方案。}}")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/17/zh (Created page with "== 用法 ==")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/15/zh (Created page with "添加如下内容至 <code>~/.config/nix/nix.conf</code> 或 <code>/etc/nix/nix.conf</code>:")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/13/zh (Created page with "====Nix 独立程序====")
- 19:25, 28 August 2025 Weijia talk contribs created page Translations:Flakes/11/zh (Created page with "添加如下内容至您的 home manager 配置:")
- 19:24, 28 August 2025 Weijia talk contribs created page Translations:Flakes/10/zh (Created page with "====Home Manager====")