nixfiles/profiles/remoteBuilders.nix

58 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"
2024-03-30 09:28:16 +00:00
"lappy-surface"
2023-09-14 19:44:27 +01:00
]
2023-09-18 03:56:58 +01:00
then usbSSHKeyFile
2023-10-16 18:17:28 +01:00
else if builtins.elem currentHostname ["wsl"]
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=";
2024-03-09 22:18:26 +00:00
maxJobs = 2;
speedFactor = 2;
}
]))
(mkIf (currentHostname != "vault") (mkMerge [
builderDefaults
{
2023-09-14 19:44:27 +01:00
hostName = "vault.servers.genderfucked.monster";
systems = ["aarch64-linux"];
supportedFeatures = ["native-arm64"];
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSURGTlFjUTdkbUlRS1lqMUVVTFBlcTI4d2hzMTg2YVZ0WitWU05rd3I2aEkgcm9vdEB2YXVsdAo=";
maxJobs = 1;
2023-09-14 19:44:27 +01:00
speedFactor = 1;
}
]))
2023-09-14 19:44:27 +01:00
];
nix.distributedBuilds = true;
nix.extraOptions = "builders-use-substitutes = true";
}