nixfiles/profiles/remoteBuilders.nix

55 lines
1.5 KiB
Nix

{
lib,
config,
...
}: let
inherit (lib.modules) mkIf mkMerge;
currentHostname = config.networking.hostName;
usbSSHKeyFile = "/usb/ssh-keys/chaos.priv";
sshKeyFile =
if
builtins.elem currentHostname [
"lappy-t495"
"tablet"
]
then usbSSHKeyFile
else throw "host isn't configured for remote-builders";
builderDefaults = {
sshUser = "root";
sshKey = sshKeyFile;
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 = 4;
speedFactor = 3;
}
]))
(mkIf (currentHostname != "vault") (mkMerge [
builderDefaults
{
hostName = "vault.servers.genderfucked.monster";
systems = ["aarch64-linux"];
supportedFeatures = ["native-arm64"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSURGTlFjUTdkbUlRS1lqMUVVTFBlcTI4d2hzMTg2YVZ0WitWU05rd3I2aEkgcm9vdEB2YXVsdAo=";
maxJobs = 1;
speedFactor = 1;
}
]))
];
nix.distributedBuilds = true;
nix.extraOptions = "builders-use-substitutes = true";
}