换源/Nix / NixOS
Nix / NixOS 镜像源
Nix 二进制缓存(substituters)与 nix-channels / nixpkgs 国内镜像,nix build / nixos-rebuild 提速。
可用镜像源(4)
| 源 | 地址 | 说明 |
|---|---|---|
| 清华 nix-channels | https://mirrors.tuna.tsinghua.edu.cn/nix-channels/ | — |
| 清华 store 缓存 | https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store | — |
| 官方 | https://cache.nixos.org/ | 还原时使用 |
| 中科大 USTC | https://mirrors.ustc.edu.cn/nix-channels/ | 教育网 |
换源方法
nix.conf substituters
substituters = https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store https://cache.nixos.org/channel 换源
nix-channel --add https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixpkgs-unstable nixpkgs
nix-channel --update使用提示
- ·先用 `chsrc measure
` 或本站节点测速挑最快源,别盲选。 - ·镜像同步通常滞后几分钟到几小时,刚发布的版本拉不到时临时回官方源。
- ·锁定版本 / 提交 lockfile,避免不同源之间版本漂移。
- ·私有包与凭据不要发给第三方镜像;私有仓库走官方或自建源。