2023-09-14 19:44:27 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2023-09-21 05:06:27 +01:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
2023-09-14 19:44:27 +01:00
|
|
|
|
2023-09-18 03:56:58 +01:00
|
|
|
currentHostname = config.networking.hostName;
|
2023-09-14 19:44:27 +01:00
|
|
|
|
2023-09-18 03:56:58 +01:00
|
|
|
usbSSHKeyFile = "/usb/ssh-keys/chaos.priv";
|
2023-10-14 12:35:20 +01:00
|
|
|
normalSSHKeyFile = "/home/chaos/.ssh/id_ed25519";
|
2023-09-14 19:44:27 +01:00
|
|
|
|
2023-09-18 03:56:58 +01:00
|
|
|
sshKeyFile =
|
2023-09-14 19:44:27 +01:00
|
|
|
if
|
2023-09-18 03:56:58 +01:00
|
|
|
builtins.elem currentHostname [
|
2023-09-14 19:44:27 +01:00
|
|
|
"lappy-t495"
|
|
|
|
"tablet"
|
|
|
|
]
|
2023-09-18 03:56:58 +01:00
|
|
|
then usbSSHKeyFile
|
2023-10-14 12:35:20 +01:00
|
|
|
else if builtins.elem currentHostname ["wsl"] then normalSSHKeyFile else throw "host isn't configured for remote-builders";
|
2023-09-14 19:44:27 +01:00
|
|
|
|
|
|
|
builderDefaults = {
|
|
|
|
sshUser = "root";
|
2023-09-18 03:56:58 +01:00
|
|
|
sshKey = sshKeyFile;
|
2023-09-14 19:44:27 +01:00
|
|
|
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
|
|
|
|
mandatoryFeatures = [];
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
nix.buildMachines = [
|
2023-09-21 05:06:27 +01:00
|
|
|
(mkIf (currentHostname != "hetzner-arm") (mkMerge [
|
|
|
|
builderDefaults
|
|
|
|
{
|
|
|
|
hostName = "hetzner-arm.servers.genderfucked.monster";
|
|
|
|
systems = ["aarch64-linux"];
|
|
|
|
supportedFeatures = ["native-arm64"];
|
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUk5cGM0REU1UlV4UUp2T1pwenFOQWVac0JlRW1kcmp4OFlnV3orVXBMckcgcm9vdEBoZXR6bmVyLWFybQo=";
|
|
|
|
maxJobs = 4;
|
|
|
|
speedFactor = 3;
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
(mkIf (currentHostname != "vault") (mkMerge [
|
|
|
|
builderDefaults
|
|
|
|
{
|
2023-09-14 19:44:27 +01:00
|
|
|
hostName = "vault.servers.genderfucked.monster";
|
2023-09-21 05:06:27 +01:00
|
|
|
systems = ["aarch64-linux"];
|
|
|
|
supportedFeatures = ["native-arm64"];
|
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSURGTlFjUTdkbUlRS1lqMUVVTFBlcTI4d2hzMTg2YVZ0WitWU05rd3I2aEkgcm9vdEB2YXVsdAo=";
|
|
|
|
maxJobs = 1;
|
2023-09-14 19:44:27 +01:00
|
|
|
speedFactor = 1;
|
2023-09-21 05:06:27 +01:00
|
|
|
}
|
|
|
|
]))
|
2023-09-14 19:44:27 +01:00
|
|
|
];
|
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.extraOptions = "builders-use-substitutes = true";
|
|
|
|
}
|