Separate enabling distributed build vs substituters.
This commit is contained in:
@@ -10,7 +10,14 @@
|
||||
|
||||
let
|
||||
make_machine_config = name: {
|
||||
enable = lib.mkOption {
|
||||
enable_build = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to use the ${name} machine during distributed builds.";
|
||||
};
|
||||
|
||||
enable_substituter = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
@@ -59,11 +66,30 @@ let
|
||||
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
|
||||
};
|
||||
};
|
||||
build_machine_list = (
|
||||
map (
|
||||
hostname:
|
||||
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable_build (
|
||||
lib.mkMerge [
|
||||
{
|
||||
hostName = hostname;
|
||||
sshUser = "nixworker";
|
||||
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
||||
maxJobs = 1;
|
||||
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
|
||||
protocol = "ssh-ng";
|
||||
}
|
||||
static_host_configs."${hostname}"
|
||||
config.me.distributed_build.machines."${hostname}".additional_config
|
||||
]
|
||||
))
|
||||
) (builtins.attrNames all_nixos_configs)
|
||||
);
|
||||
substituters_list = (
|
||||
map (
|
||||
hostname:
|
||||
(lib.mkIf (
|
||||
config.me.distributed_build.machines."${hostname}".enable
|
||||
config.me.distributed_build.machines."${hostname}".enable_substituter
|
||||
&& config.me.distributed_build.machines."${hostname}".substituter_url != null
|
||||
) (config.me.distributed_build.machines."${hostname}".substituter_url))
|
||||
) (builtins.attrNames all_nixos_configs)
|
||||
@@ -112,25 +138,7 @@ in
|
||||
];
|
||||
}
|
||||
{
|
||||
nix.buildMachines = (
|
||||
map (
|
||||
hostname:
|
||||
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
hostName = hostname;
|
||||
sshUser = "nixworker";
|
||||
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
||||
maxJobs = 1;
|
||||
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
|
||||
protocol = "ssh-ng";
|
||||
}
|
||||
static_host_configs."${hostname}"
|
||||
config.me.distributed_build.machines."${hostname}".additional_config
|
||||
]
|
||||
))
|
||||
) (builtins.attrNames all_nixos_configs)
|
||||
);
|
||||
nix.buildMachines = build_machine_list;
|
||||
}
|
||||
(lib.mkIf has_any_substituters {
|
||||
nix.settings.substitute = lib.mkForce true;
|
||||
|
||||
Reference in New Issue
Block a user