2025-01-08 11:59:40 +00:00
|
|
|
{
|
2025-01-08 20:00:36 +00:00
|
|
|
pkgs,
|
|
|
|
configVars,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
remoteMachineIp = configVars.networking.addresses.remote-builder.ip;
|
|
|
|
in {
|
2025-01-08 19:29:33 +00:00
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.settings.builders-use-substitutes = true;
|
|
|
|
nix.settings.max-jobs = 0;
|
|
|
|
nix.settings.trusted-substituters = ["ssh://${remoteMachineIp}"];
|
|
|
|
nix.settings.substituters = ["ssh://${remoteMachineIp}"];
|
|
|
|
|
|
|
|
nix.buildMachines = [
|
|
|
|
{
|
2025-01-08 20:00:36 +00:00
|
|
|
hostName = "remotebuild@${remoteMachineIp}";
|
2025-01-08 19:29:33 +00:00
|
|
|
speedFactor = 1;
|
|
|
|
maxJobs = 10;
|
|
|
|
sshKey = "/root/.ssh/remotebuild";
|
|
|
|
system = pkgs.stdenv.hostPlatform.system;
|
2025-01-08 20:00:36 +00:00
|
|
|
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
|
2025-01-08 19:29:33 +00:00
|
|
|
}
|
|
|
|
];
|
2025-01-08 20:00:36 +00:00
|
|
|
programs.ssh.extraConfig = ''
|
|
|
|
Host ${remoteMachineIp}
|
|
|
|
Port 22
|
|
|
|
User remotebuild
|
|
|
|
IdentitiesOnly yes
|
|
|
|
IdentityFile /root/.ssh/remotebuild
|
|
|
|
'';
|
2025-01-08 12:15:11 +00:00
|
|
|
sops.secrets = {
|
2025-01-08 11:59:40 +00:00
|
|
|
"ssh_keys/root/remotebuild" = {
|
|
|
|
path = "/root/.ssh/remotebuild";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|