nixfiles/profiles/remoteBuilders.nix
2023-09-18 03:56:58 +01:00

49 lines
1.4 KiB
Nix

{
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
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-vm") (builderDefaults
// {
hostName = "hetzner-vm.servers.genderfucked.monster";
systems = ["x86_64-linux" "aarch64-linux"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU1JdDJBQnF3SGhNano5cjZhdHY0WHVYNTh4RVdlU3RrbVhVd3ZNVkd2NHcgcm9vdEBuaXhvcwo=";
maxJobs = 3;
speedFactor = 2;
}))
(mkIf (currentHostname != "vault") (builderDefaults
// {
hostName = "vault.servers.genderfucked.monster";
systems = ["x86_64-linux"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU16L1dyaG81MTFGdzhXN3FsU0NUY1V4cWh4TGlBQkJXbFNNNFRNNzJ5RWQgcm9vdEBuaXhvcwo=";
maxJobs = 2;
speedFactor = 1;
}))
];
nix.distributedBuilds = true;
nix.extraOptions = "builders-use-substitutes = true";
}