nixcache: tidy up substituter config
This commit is contained in:
parent
fdc18821ca
commit
2f5c33b2b4
|
@ -22,6 +22,8 @@
|
||||||
sane.services.wg-home.enable = true;
|
sane.services.wg-home.enable = true;
|
||||||
sane.services.wg-home.enableWan = true;
|
sane.services.wg-home.enableWan = true;
|
||||||
sane.services.wg-home.ip = config.sane.hosts.by-name."servo".wg-home.ip;
|
sane.services.wg-home.ip = config.sane.hosts.by-name."servo".wg-home.ip;
|
||||||
|
sane.services.nixcache.substituters.servo.enable = false;
|
||||||
|
sane.services.nixcache.substituters.desko.enable = false;
|
||||||
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
|
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
|
||||||
|
|
||||||
# automatically log in at the virtual consoles.
|
# automatically log in at the virtual consoles.
|
||||||
|
|
|
@ -25,16 +25,16 @@ in
|
||||||
default = config.sane.nixcache.enable;
|
default = config.sane.nixcache.enable;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
sane.nixcache.substituters = mkOption {
|
sane.nixcache.substituters = let
|
||||||
type = types.listOf types.str;
|
subOpt = mkOption {
|
||||||
default =
|
default = true;
|
||||||
# TODO: make these blacklisted entries injectable
|
type = types.bool;
|
||||||
(lib.optional (hostName != "servo") "https://nixcache.uninsane.org")
|
};
|
||||||
++ (lib.optional (hostName != "servo" && hostName != "desko") "http://desko:5000")
|
in {
|
||||||
++ [
|
servo = subOpt;
|
||||||
"https://nix-community.cachix.org"
|
desko = subOpt;
|
||||||
"https://cache.nixos.org/"
|
nixos = subOpt;
|
||||||
];
|
cachix = subOpt;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,12 @@ in
|
||||||
# to explicitly build from a specific cache (in case others are down):
|
# to explicitly build from a specific cache (in case others are down):
|
||||||
# - `nixos-rebuild ... --option substituters https://cache.nixos.org`
|
# - `nixos-rebuild ... --option substituters https://cache.nixos.org`
|
||||||
# - `nix build ... --substituters http://desko:5000`
|
# - `nix build ... --substituters http://desko:5000`
|
||||||
nix.settings.substituters = mkIf cfg.enable cfg.substituters;
|
nix.settings.substituters = mkIf cfg.enable (lib.flatten [
|
||||||
|
(lib.optional cfg.substituters.servo "https://nixcache.uninsane.org")
|
||||||
|
(lib.optional cfg.substituters.desko "http://desko:5000")
|
||||||
|
(lib.optional cfg.substituters.nixos "https://cache.nixos.org/")
|
||||||
|
(lib.optional cfg.substituters.cachix "https://nix-community.cachix.org")
|
||||||
|
]);
|
||||||
# always trust our keys (so one can explicitly use a substituter even if it's not the default
|
# always trust our keys (so one can explicitly use a substituter even if it's not the default
|
||||||
nix.settings.trusted-public-keys = mkIf cfg.enable-trusted-keys [
|
nix.settings.trusted-public-keys = mkIf cfg.enable-trusted-keys [
|
||||||
"nixcache.uninsane.org:r3WILM6+QrkmsLgqVQcEdibFD7Q/4gyzD9dGT33GP70="
|
"nixcache.uninsane.org:r3WILM6+QrkmsLgqVQcEdibFD7Q/4gyzD9dGT33GP70="
|
||||||
|
|
Loading…
Reference in New Issue
Block a user