mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-10 14:54:13 +00:00
fix: duplicated header id
This commit is contained in:
parent
d99c1edfcc
commit
fc7b7ffee9
2 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
# Custom NIX_PATH and Flake Registry {#custom-nix-path-and-flake-registry}
|
||||
# Custom NIX_PATH and Flake Registry
|
||||
|
||||
## Introduction to NIX_PATH {#nix-path-introduction}
|
||||
|
||||
|
@ -18,7 +18,7 @@ By default, Nix looks up the corresponding GitHub repository address for this ID
|
|||
|
||||
For instance, if we execute `nix run nixpkgs#ponysay hello`, Nix will automatically retrieve the GitHub repository address for `nixpkgs` from the aforementioned JSON file. It then downloads the repository, locates the `flake.nix` within, and runs the corresponding `ponysay` package.
|
||||
|
||||
## Custom NIX_PATH and Flake Registry {#custom-nix-path-and-flake-registry}
|
||||
## Custom NIX_PATH and Flake Registry {#custom-nix-path-and-flake-registry-1}
|
||||
|
||||
The roles of `NIX_PATH` and the Flake Registry have been explained earlier.
|
||||
In daily use, we typically want the `nixpkgs` used in commands like `nix repl '<nixpkgs>'`, `nix run nixpkgs#ponysay hello` to match the system's `nixpkgs`. This requires us to customize the `NIX_PATH` and Flake Registry.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# 自定义 NIX_PATH 与 Flake Registry {#custom-nix-path-and-flake-registry}
|
||||
# 自定义 NIX_PATH 与 Flake Registry
|
||||
|
||||
## NIX_PATH 介绍 {#nix-path-introduction}
|
||||
|
||||
|
@ -19,7 +19,7 @@ Flake Registry 是一个 Flake 注册中心,它可以帮助我们在使用 `ni
|
|||
比如说我们执行 `nix run nixpkgs#ponysay hello`,nix 会自动从上述 json 文件中找到 `nixpkgs` 对应的 github 仓库地址,然后下载这个仓库,再通过其中的 `flake.nix` 查找对应的 `ponysay` 包并运行它。
|
||||
|
||||
|
||||
## 自定义 NIX_PATH 与 Flake Registry {#custom-nix-path-and-flake-registry}
|
||||
## 自定义 NIX_PATH 与 Flake Registry {#custom-nix-path-and-flake-registry-2}
|
||||
|
||||
前面说明了 `NIX_PATH` 与 Flake Registry 的作用。
|
||||
在日常使用中,我们一般都会希望能在执行 `nix repl '<nixpkgs>'`, `nix run nixpkgs#ponysay hello` 等命令时,使用的 nixpkgs 与系统一致,这就需要我们自定义 `NIX_PATH` 与 Flake Registry。
|
||||
|
|
Loading…
Reference in a new issue