2023-09-14 19:44:27 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
|
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-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-09-14 19:44:27 +01:00
|
|
|
else throw "host isn't configured for remote-builders";
|
|
|
|
|
|
|
|
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-18 03:56:58 +01:00
|
|
|
(mkIf (currentHostname != "hetzner-vm") (builderDefaults
|
2023-09-14 19:44:27 +01:00
|
|
|
// {
|
|
|
|
hostName = "hetzner-vm.servers.genderfucked.monster";
|
|
|
|
systems = ["x86_64-linux" "aarch64-linux"];
|
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU1JdDJBQnF3SGhNano5cjZhdHY0WHVYNTh4RVdlU3RrbVhVd3ZNVkd2NHcgcm9vdEBuaXhvcwo=";
|
|
|
|
maxJobs = 3;
|
|
|
|
speedFactor = 2;
|
|
|
|
}))
|
2023-09-18 03:56:58 +01:00
|
|
|
(mkIf (currentHostname != "vault") (builderDefaults
|
2023-09-14 19:44:27 +01:00
|
|
|
// {
|
|
|
|
hostName = "vault.servers.genderfucked.monster";
|
|
|
|
systems = ["x86_64-linux"];
|
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU16L1dyaG81MTFGdzhXN3FsU0NUY1V4cWh4TGlBQkJXbFNNNFRNNzJ5RWQgcm9vdEBuaXhvcwo=";
|
|
|
|
maxJobs = 2;
|
|
|
|
speedFactor = 1;
|
|
|
|
}))
|
|
|
|
];
|
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.extraOptions = "builders-use-substitutes = true";
|
|
|
|
}
|