Automatically set distributed build's supportedFeatures based on that host's actual config.
Previously, we had two copies of the supported features for each host.
This commit is contained in:
parent
3bf912f3be
commit
eebbf9f4aa
@ -69,6 +69,8 @@
|
||||
|
||||
this_nixos_config = self.nixosConfigurations."${hostname}";
|
||||
|
||||
all_nixos_configs = self.nixosConfigurations;
|
||||
|
||||
pkgs-unoptimized = import nixpkgs-unoptimized {
|
||||
inherit (nodeConfig) system;
|
||||
hostPlatform.gcc.arch = "default";
|
||||
|
||||
@ -3,12 +3,6 @@
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
|
||||
@ -3,12 +3,6 @@
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
|
||||
@ -3,12 +3,6 @@
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
|
||||
@ -3,11 +3,5 @@
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -3,12 +3,6 @@
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
all_nixos_configs,
|
||||
...
|
||||
}:
|
||||
|
||||
@ -24,6 +25,18 @@ let
|
||||
description = "Additional config values for the buildMachines entry. For example, speedFactor.";
|
||||
};
|
||||
};
|
||||
|
||||
static_host_configs = {
|
||||
quark = {
|
||||
# From: base64 -w0 /persist/ssh/ssh_host_ed25519_key.pub
|
||||
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUx0alplYlVYTkRkU3Y1enVGbjM3eFNMZUN3S2hPKzFMdWovM2FYNFJRTEEgcm9vdEBxdWFyawo=";
|
||||
systems = [
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
# "aarch64-linux"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
@ -36,8 +49,7 @@ in
|
||||
description = "Whether we want to use multiple machines to perform a nixos-rebuild.";
|
||||
};
|
||||
|
||||
distributed_build.machines.hydra = make_machine_config "hydra";
|
||||
distributed_build.machines.quark = make_machine_config "quark";
|
||||
distributed_build.machines = lib.mapAttrs (name: value: make_machine_config name) all_nixos_configs;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.distributed_build.enable (
|
||||
@ -45,68 +57,26 @@ in
|
||||
{
|
||||
nix.distributedBuilds = true;
|
||||
}
|
||||
(lib.mkIf config.me.distributed_build.machines.hydra.enable {
|
||||
nix.buildMachines = [
|
||||
(
|
||||
{
|
||||
hostName = "hydra";
|
||||
sshUser = "nixworker";
|
||||
# sshKey = "";
|
||||
# publicHostKey = "";
|
||||
systems = [
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
# "aarch64-linux"
|
||||
];
|
||||
maxJobs = 1;
|
||||
supportedFeatures = [
|
||||
"nixos-test"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
# "kvm"
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
"gccarch-znver4"
|
||||
];
|
||||
}
|
||||
// config.me.distributed_build.machines.hydra.additional_config
|
||||
)
|
||||
];
|
||||
})
|
||||
(lib.mkIf config.me.distributed_build.machines.quark.enable {
|
||||
nix.buildMachines = [
|
||||
(
|
||||
nix.buildMachines = (
|
||||
map (
|
||||
hostname:
|
||||
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
hostName = "quark";
|
||||
hostName = hostname;
|
||||
sshUser = "nixworker";
|
||||
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
||||
# From: base64 -w0 /persist/ssh/ssh_host_ed25519_key.pub
|
||||
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUx0alplYlVYTkRkU3Y1enVGbjM3eFNMZUN3S2hPKzFMdWovM2FYNFJRTEEgcm9vdEBxdWFyawo=";
|
||||
systems = [
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
# "aarch64-linux"
|
||||
];
|
||||
maxJobs = 1;
|
||||
supportedFeatures = [
|
||||
"nixos-test"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
"gccarch-znver4"
|
||||
"gccarch-znver5"
|
||||
];
|
||||
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
|
||||
}
|
||||
static_host_configs."${hostname}"
|
||||
config.me.distributed_build.machines."${hostname}".additional_config
|
||||
]
|
||||
))
|
||||
) (builtins.attrNames all_nixos_configs)
|
||||
);
|
||||
}
|
||||
// config.me.distributed_build.machines.quark.additional_config
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user