File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/tutorials/installation Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,17 @@ nix shell nixpkgs#cowsay --option substituters "https://mirrors.tuna.tsinghua.ed
3535## 2. 使用国内镜像地址加速 Flakes Inputs 的下载
3636
3737如果你想使用 Flakes,但访问 GitHub 速度太慢,你可以使用国内的镜像地址来加速。
38-
39- 但需要注意的是,这种方式下无法锁定 nixpkgs 版本,也就失去了 Flakes 锁定依赖版本
40- 的优势。
41-
42- 示例如下,主要是将 ` nixpkgs.url ` 替换成国内镜像源的 ` nixexprs.tar.xz ` 文件的路
43- 径:
38+ 需要注意的是,如果将 ` nixpkgs.url ` 替换成 ` nixexprs.tar.xz ` 文件,
39+ 则无法锁定 nixpkgs 版本,也就失去了 Flakes 锁定依赖版本的优势。
40+ 因此,建议选择 Git 浅克隆的方式拉取 nixpkgs 镜像:
4441
4542``` nix
4643{
4744 inputs = {
48- # nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
49- nixpkgs.url = "https://mirrors.ustc.edu.cn/nix-channels/nixos-23.11/nixexprs.tar.xz";
50- # nixpkgs.url = "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixpkgs-23.11/nixexprs.tar.xz";
45+ # nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
46+ nixpkgs.url = "git+https://mirrors.nju.edu.cn/git/nixpkgs.git?ref=nixos-25.05&shallow=1";
47+ # nixpkgs.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-25.05&shallow=1";
48+ # nixpkgs.url = "https://mirrors.ustc.edu.cn/nix-channels/nixos-25.05/nixexprs.tar.xz";
5149 };
5250 outputs = inputs@{ self, nixpkgs, ... }: {
5351 nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem {
You can’t perform that action at this time.
0 commit comments