nixfiles/profiles/remote-builders.nix
2023-09-14 19:44:27 +01:00

49 lines
1.4 KiB
Nix

{
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
current_machine_hostname = config.networking.hostName;
usb_ssh_key_file = "/usb/ssh-keys/chaos.priv";
ssh_key_file =
if
builtins.elem current_machine_hostname [
"lappy-t495"
"tablet"
]
then usb_ssh_key_file
else throw "host isn't configured for remote-builders";
builderDefaults = {
sshUser = "root";
sshKey = ssh_key_file;
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
mandatoryFeatures = [];
};
in {
nix.buildMachines = [
(mkIf (current_machine_hostname != "hetzner-vm") (builderDefaults
// {
hostName = "hetzner-vm.servers.genderfucked.monster";
systems = ["x86_64-linux" "aarch64-linux"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU1JdDJBQnF3SGhNano5cjZhdHY0WHVYNTh4RVdlU3RrbVhVd3ZNVkd2NHcgcm9vdEBuaXhvcwo=";
maxJobs = 3;
speedFactor = 2;
}))
(mkIf (current_machine_hostname != "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";
}