2023-09-01 09:00:36 -06:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2022-08-25 12:21:35 -06:00
|
|
|
with lib; {
|
|
|
|
options = {
|
2023-09-01 09:00:36 -06:00
|
|
|
buildConsumer = {enable = mkEnableOption "Use remote build machines";};
|
2022-08-25 12:21:35 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.buildConsumer.enable {
|
|
|
|
programs.ssh.knownHosts = {
|
|
|
|
pcake = {
|
2023-09-01 09:00:36 -06:00
|
|
|
hostNames = ["pcake" "pcake.tapenet.org" "10.6.0.202"];
|
|
|
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHgqVw3QWNG6Ty5o2HwW+25Eh59W3lZ30+wMqTEkUZVH";
|
2022-08-25 12:21:35 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
programs.ssh.extraConfig = ''
|
|
|
|
Host pcake
|
|
|
|
HostName 10.6.0.202
|
|
|
|
IdentitiesOnly yes
|
|
|
|
IdentityFile /root/.ssh/nix_remote
|
|
|
|
'';
|
2023-09-01 09:00:36 -06:00
|
|
|
nix.buildMachines = [
|
|
|
|
{
|
|
|
|
hostName = "pcake";
|
|
|
|
systems = ["x86_64-linux" "aarch64-linux"];
|
|
|
|
maxJobs = 2;
|
|
|
|
speedFactor = 4;
|
|
|
|
supportedFeatures = ["kvm" "big-parallel" "nixos-test" "benchmark"];
|
|
|
|
mandatoryFeatures = [];
|
|
|
|
}
|
|
|
|
];
|
2022-08-25 12:21:35 -06:00
|
|
|
|
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.extraOptions = ''
|
|
|
|
builders-use-substitutes = true
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|