only enable home manager binary caches if home manager is enabled
This commit is contained in:
parent
b1adbd1033
commit
246ce7eeb1
2 changed files with 16 additions and 7 deletions
|
|
@ -72,7 +72,10 @@ forDevice (
|
||||||
# keep-sorted start
|
# keep-sorted start
|
||||||
autoupdate.enable = true;
|
autoupdate.enable = true;
|
||||||
distributedBuilds.enable = true;
|
distributedBuilds.enable = true;
|
||||||
extraCaches.enable = true;
|
extraCaches = {
|
||||||
|
enable = true;
|
||||||
|
homeManager = home-manager-users != { };
|
||||||
|
};
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
globalinstalls.enable = true;
|
globalinstalls.enable = true;
|
||||||
lixIsNix.enable = true;
|
lixIsNix.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,33 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.extraCaches;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.my.extraCaches.enable = lib.mkEnableOption "extra Nix binary caches";
|
options.my.extraCaches = {
|
||||||
|
enable = lib.mkEnableOption "extra Nix binary caches";
|
||||||
|
homeManager = lib.mkEnableOption "the home-manager (nix-community) binary cache";
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.my.extraCaches.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
substituters = [
|
substituters = [
|
||||||
# keep-sorted start
|
# keep-sorted start
|
||||||
"https://cache.lix.systems"
|
"https://cache.lix.systems"
|
||||||
"https://cache.nixos.org/"
|
"https://cache.nixos.org/"
|
||||||
"https://niri.cachix.org"
|
"https://niri.cachix.org"
|
||||||
"https://nix-community.cachix.org"
|
|
||||||
"https://nixos-raspberrypi.cachix.org"
|
"https://nixos-raspberrypi.cachix.org"
|
||||||
# keep-sorted end
|
# keep-sorted end
|
||||||
];
|
]
|
||||||
|
++ lib.optional cfg.homeManager "https://nix-community.cachix.org";
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
# keep-sorted start
|
# keep-sorted start
|
||||||
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
||||||
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
||||||
# keep-sorted end
|
# keep-sorted end
|
||||||
];
|
]
|
||||||
|
++ lib.optional cfg.homeManager "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue