From cf51f22984e242d2d42be8156485a5c8578b52b5 Mon Sep 17 00:00:00 2001 From: Ryan Yin <xiaoyin_c@qq.com> Date: Mon, 9 Oct 2023 23:23:52 +0800 Subject: [PATCH] fix: broken links --- docs/best-practices/debugging.md | 2 +- docs/development/intro.md | 2 +- docs/nixos-with-flakes/modularize-the-configuration.md | 2 +- docs/nixpkgs/intro.md | 2 +- docs/nixpkgs/multiple-nixpkgs.md | 4 ++-- docs/nixpkgs/overriding.md | 2 +- docs/zh/best-practices/debugging.md | 2 +- docs/zh/development/intro.md | 2 +- docs/zh/nixos-with-flakes/modularize-the-configuration.md | 2 +- docs/zh/nixpkgs/intro.md | 2 +- docs/zh/nixpkgs/multiple-nixpkgs.md | 4 ++-- docs/zh/nixpkgs/overriding.md | 2 +- docs/zh/the-nix-language/index.md | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/best-practices/debugging.md b/docs/best-practices/debugging.md index 96cc2db..f2e36c3 100644 --- a/docs/best-practices/debugging.md +++ b/docs/best-practices/debugging.md @@ -157,5 +157,5 @@ TODO - [How to make nix build display all commands executed by make?](https://www.reddit.com/r/NixOS/comments/14stdgy/how_to_make_nix_build_display_all_commands/) - use `NIX_DEBUG=7` in derivation -- [Collection of functions useful for debugging broken nix expressions.](https://github.com/NixOS/nixpkgs/blob/master/lib/debug.nix) +- [Collection of functions useful for debugging broken nix expressions.](https://github.com/NixOS/nixpkgs/blob/f3d9f46/lib/debug.nix) diff --git a/docs/development/intro.md b/docs/development/intro.md index d00ac94..effbdcf 100644 --- a/docs/development/intro.md +++ b/docs/development/intro.md @@ -12,7 +12,7 @@ In the following sections, we'll introduce how the development environment works We can create a development environment using `pkgs.mkShell { ... }` and open an interactive Bash shell of this development environment using `nix develop`. -To see how `pkgs.mkShell` works, let's take a look at [its source code](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/mkshell/default.nix). +To see how `pkgs.mkShell` works, let's take a look at [its source code](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/build-support/mkshell/default.nix). ```nix { lib, stdenv, buildEnv }: diff --git a/docs/nixos-with-flakes/modularize-the-configuration.md b/docs/nixos-with-flakes/modularize-the-configuration.md index 7102b0b..b5280b7 100644 --- a/docs/nixos-with-flakes/modularize-the-configuration.md +++ b/docs/nixos-with-flakes/modularize-the-configuration.md @@ -248,4 +248,4 @@ As you can see, the order of `systemPackages` is `git -> curl -> default package ## References - [Nix modules: Improving Nix's discoverability and usability](https://cfp.nixcon.org/nixcon2020/talk/K89WJY/) -- [Module System - Nixpkgs](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/doc/module-system/module-system.chapter.md) +- [Module System - Nixpkgs](https://github.com/NixOS/nixpkgs/blob/eab660d/doc/module-system/module-system.chapter.md) diff --git a/docs/nixpkgs/intro.md b/docs/nixpkgs/intro.md index 258eaf9..65ab4e9 100644 --- a/docs/nixpkgs/intro.md +++ b/docs/nixpkgs/intro.md @@ -5,7 +5,7 @@ We know that many programs have a large number of build parameters that need to be configured, and different users may want to use different build parameters. This is where `Overriding` and `Overlays` come in handy. Let me give you a few examples I have encountered: 1. [`fcitx5-rime.nix`](https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix): By default, `fcitx5-rime` use `rime-data` as the value of `rimeDataPkgs`, but this parameter can be customized by `override`. -2. [`vscode/with-extensions.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/with-extensions.nix): This package for VS Code can also be customized by overriding the value of `vscodeExtensions`, thus we can install some custom plugins into VS Code. +2. [`vscode/with-extensions.nix`](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/applications/editors/vscode/with-extensions.nix): This package for VS Code can also be customized by overriding the value of `vscodeExtensions`, thus we can install some custom plugins into VS Code. - [`nix-vscode-extensions`](https://github.com/nix-community/nix-vscode-extensions): This is a vscode plugin manager implemented by overriding `vscodeExtensions`. 3. [`firefox/common.nix`](https://github.com/NixOS/nixpkgs/blob/416ffcd08f1f16211130cd9571f74322e98ecef6/pkgs/applications/networking/browsers/firefox/common.nix): Firefox has many customizable parameters too. 4. ... diff --git a/docs/nixpkgs/multiple-nixpkgs.md b/docs/nixpkgs/multiple-nixpkgs.md index 0e29865..a0601ba 100644 --- a/docs/nixpkgs/multiple-nixpkgs.md +++ b/docs/nixpkgs/multiple-nixpkgs.md @@ -54,8 +54,8 @@ We have learned in our study of Nix syntax: > The `import` expression takes a path to another Nix file as an argument and returns the execution result of that Nix file. > If the argument to `import` is a folder path, it returns the execution result of the `default.nix` file within that folder. -`nixpkgs` is a flake with a `default.nix` file in its root directory. So, `import nixpkgs` essentially returns the execution result of [nixpkgs/default.nix](https://github.com/NixOS/nixpkgs/blob/master/default.nix). -Starting from this file, you can find that the implementation of `import nixpkgs` is in [pkgs/top-level/impure.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/impure.nix), as excerpted below: +`nixpkgs` is a flake with a `default.nix` file in its root directory. So, `import nixpkgs` essentially returns the execution result of [nixpkgs/default.nix](https://github.com/NixOS/nixpkgs/blob/f3d9f46/default.nix). +Starting from this file, you can find that the implementation of `import nixpkgs` is in [pkgs/top-level/impure.nix](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/top-level/impure.nix), as excerpted below: ```nix # ... skipping some lines diff --git a/docs/nixpkgs/overriding.md b/docs/nixpkgs/overriding.md index 1d299cc..10e1996 100644 --- a/docs/nixpkgs/overriding.md +++ b/docs/nixpkgs/overriding.md @@ -15,7 +15,7 @@ To find out which parameters of a specific package can be overridden, there are By using these methods, you can discover the input parameters of a package and determine which ones can be modified using `override`. -For example, let's take a look at the source code of [pkgs.hello](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/misc/hello/default.nix): +For example, let's take a look at the source code of [pkgs.hello](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/applications/misc/hello/default.nix): ```nix { callPackage diff --git a/docs/zh/best-practices/debugging.md b/docs/zh/best-practices/debugging.md index 4ddbcc9..39e61b7 100644 --- a/docs/zh/best-practices/debugging.md +++ b/docs/zh/best-practices/debugging.md @@ -153,6 +153,6 @@ TODO - [How to make nix build display all commands executed by make?](https://www.reddit.com/r/NixOS/comments/14stdgy/how_to_make_nix_build_display_all_commands/) - use `NIX_DEBUG=7` in derivation -- [Collection of functions useful for debugging broken nix expressions.](https://github.com/NixOS/nixpkgs/blob/master/lib/debug.nix) +- [Collection of functions useful for debugging broken nix expressions.](https://github.com/NixOS/nixpkgs/blob/f3d9f46/lib/debug.nix) diff --git a/docs/zh/development/intro.md b/docs/zh/development/intro.md index b2b3e22..6dfec5c 100644 --- a/docs/zh/development/intro.md +++ b/docs/zh/development/intro.md @@ -16,7 +16,7 @@ 为了更好的使用上述两个功能,我们先来看看它们的原理。 -[`pkgs.mkShell` 的源码](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/mkshell/default.nix)如下: +[`pkgs.mkShell` 的源码](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/build-support/mkshell/default.nix)如下: ```nix { lib, stdenv, buildEnv }: diff --git a/docs/zh/nixos-with-flakes/modularize-the-configuration.md b/docs/zh/nixos-with-flakes/modularize-the-configuration.md index aa8fc21..a5ef688 100644 --- a/docs/zh/nixos-with-flakes/modularize-the-configuration.md +++ b/docs/zh/nixos-with-flakes/modularize-the-configuration.md @@ -254,5 +254,5 @@ nix-repl> outputs.nixosConfigurations.nixos-test.config.environment.systemPackag ## References - [Nix modules: Improving Nix's discoverability and usability ](https://cfp.nixcon.org/nixcon2020/talk/K89WJY/) -- [Module System - Nixpkgs](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/doc/module-system/module-system.chapter.md) +- [Module System - Nixpkgs](https://github.com/NixOS/nixpkgs/blob/eab660d/doc/module-system/module-system.chapter.md) - [Misterio77/nix-starter-configs](https://github.com/Misterio77/nix-starter-configs) diff --git a/docs/zh/nixpkgs/intro.md b/docs/zh/nixpkgs/intro.md index 012ca2c..d39cca4 100644 --- a/docs/zh/nixpkgs/intro.md +++ b/docs/zh/nixpkgs/intro.md @@ -5,7 +5,7 @@ callPackage、Overriding 与 Overlays 是在使用 Nix 时偶尔会用到的技 我们知道许多程序都有大量构建参数需要配置,不同的用户会希望使用不同的构建参数,这时候就需要 Overriding 与 Overlays 来实现。我举几个我遇到过的例子: 1. [fcitx5-rime.nix](https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix): fcitx5-rime 的 `rimeDataPkgs` 默认使用 `rime-data` 包,但是也可以通过 override 来自定义该参数的值,以加载自定义的 rime 配置(比如加载小鹤音形输入法配置)。 -2. [vscode/with-extensions.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/with-extensions.nix): vscode 的这个包也可以通过 override 来自定义 `vscodeExtensions` 参数的值来安装自定义插件。 +2. [vscode/with-extensions.nix](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/applications/editors/vscode/with-extensions.nix): vscode 的这个包也可以通过 override 来自定义 `vscodeExtensions` 参数的值来安装自定义插件。 1. [nix-vscode-extensions](https://github.com/nix-community/nix-vscode-extensions): 就是利用该参数实现的 vscode 插件管理 3. [firefox/common.nix](https://github.com/NixOS/nixpkgs/blob/416ffcd08f1f16211130cd9571f74322e98ecef6/pkgs/applications/networking/browsers/firefox/common.nix): firefox 同样有许多可自定义的参数 4. 等等 diff --git a/docs/zh/nixpkgs/multiple-nixpkgs.md b/docs/zh/nixpkgs/multiple-nixpkgs.md index e7543d3..fc67216 100644 --- a/docs/zh/nixpkgs/multiple-nixpkgs.md +++ b/docs/zh/nixpkgs/multiple-nixpkgs.md @@ -54,8 +54,8 @@ > `import` 表达式以其他 Nix 文件的路径作为参数,返回该 Nix 文件的执行结果。 > `import` 的参数如果为文件夹路径,那么会返回该文件夹下的 `default.nix` 文件的执行结果。 -`nixpkgs` 是一个 Git 仓库,它的根目录下刚好有一个 `default.nix` 文件,那么答案就呼之欲出了:`import nixpkgs` 就是返回 [nixpkgs/default.nix](https://github.com/NixOS/nixpkgs/blob/master/default.nix) 文件的执行结果。 -从这个文件开始探索,就能找到 `import nixpkgs` 的实现代码是 [pkgs/top-level/impure.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/impure.nix),这里截取部分内容: +`nixpkgs` 是一个 Git 仓库,它的根目录下刚好有一个 `default.nix` 文件,那么答案就呼之欲出了:`import nixpkgs` 就是返回 [nixpkgs/default.nix](https://github.com/NixOS/nixpkgs/blob/f3d9f46/default.nix) 文件的执行结果。 +从这个文件开始探索,就能找到 `import nixpkgs` 的实现代码是 [pkgs/top-level/impure.nix](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/top-level/impure.nix),这里截取部分内容: ```nix # ... skip some lines diff --git a/docs/zh/nixpkgs/overriding.md b/docs/zh/nixpkgs/overriding.md index 0abf71b..1eca1dd 100644 --- a/docs/zh/nixpkgs/overriding.md +++ b/docs/zh/nixpkgs/overriding.md @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { ``` 除了覆写参数,还可以通过 `overrideAttrs` 来覆写使用 `stdenv.mkDerivation` 构建的 Derivation 的属性。 -以 [pkgs.hello](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/misc/hello/default.nix) 为例,首先通过前述方法查看这个包的源码: +以 [pkgs.hello](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/applications/misc/hello/default.nix) 为例,首先通过前述方法查看这个包的源码: ```nix { callPackage diff --git a/docs/zh/the-nix-language/index.md b/docs/zh/the-nix-language/index.md index 7f6900f..5ff3329 100644 --- a/docs/zh/the-nix-language/index.md +++ b/docs/zh/the-nix-language/index.md @@ -393,7 +393,7 @@ Store Object 的存放路径格式为 `/nix/store/<hash>-<name>`,其中 `<hash Derivation 实质上只是一个 attribute set,Nix 底层会使用内置函数 `builtins.derivation` 将这个 attribute set 构建为一个 Store Object。 我们实际编写 Derivation 时,通常使用的是 `stdenv.mkDerivation`,它是前述内置函数 `builtins.derivation` 的 Nix 语言 wrapper,屏蔽了底层的细节,简化了用法。 -一个简单的 Derivation 如下,它声明了一个名为 hello 的应用程序(摘抄自 [nixpkgs/pkgs/hello](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hello/default.nix)): +一个简单的 Derivation 如下,它声明了一个名为 hello 的应用程序(摘抄自 [nixpkgs/pkgs/hello](https://github.com/NixOS/nixpkgs/blob/f3d9f46/pkgs/applications/misc/hello/default.nix)): ```nix { callPackage