nixfiles/profiles/nixos/remoteBuilders.nix

59 lines
1.6 KiB
Nix
Raw Normal View History

2023-09-14 19:44:27 +01:00
{
lib,
config,
...
}: let
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"
]
2023-09-18 03:56:58 +01:00
then usbSSHKeyFile
else if
builtins.elem currentHostname [
]
2023-10-16 18:17:28 +01:00
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 = [
(mkIf (currentHostname != "hetzner-arm") (mkMerge [
builderDefaults
{
hostName = "hetzner-arm.servers.genderfucked.monster";
systems = ["aarch64-linux"];
supportedFeatures = ["native-arm64"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUk5cGM0REU1UlV4UUp2T1pwenFOQWVac0JlRW1kcmp4OFlnV3orVXBMckcgcm9vdEBoZXR6bmVyLWFybQo=";
maxJobs = 3;
speedFactor = 1;
}
]))
(mkIf (currentHostname != "raspberry-pi5") (mkMerge [
builderDefaults
{
hostName = "raspberry-pi5.servers.genderfucked.monster";
systems = ["aarch64-linux"];
supportedFeatures = ["native-arm64"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUNZNFpuQ1NVeWpjOHR3UXVpMzhwU21qdHluSVZUVnFiNzB5blNRa0Z3anYgcm9vdEByYXNwYmVycnkK";
maxJobs = 4;
speedFactor = 4;
}
]))
2023-09-14 19:44:27 +01:00
];
nix.distributedBuilds = true;
nix.extraOptions = "builders-use-substitutes = true";
}