hosts: add nix-cache module

This commit is contained in:
2026-05-16 23:48:31 +08:00
parent 92ecc0cccc
commit 3af3076a86
3 changed files with 31 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
{ inputs, lib, pkgs, ... }:
{
nix.settings = {
substituters =
let
channelStore = x: "https://${x}/nix-channels/store";
mirrors = map (x: channelStore "mirrors.${x}.edu.cn") [
"bfsu"
"tuna.tsinghua"
"ustc"
];
cachix = x: "https://${x}.cachix.org";
in
lib.flatten [
mirrors
(cachix "nix-community")
"https://cache.nixos.org"
(cachix "inclyc")
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"inclyc.cachix.org-1:izGZ+f/JLPovKX1OKd3rQZ8nPOCpvPij3+bebjxdZ2k="
];
builders-use-substitutes = true;
};
}