xin/dbuild/build-consumer.nix

42 lines
1006 B
Nix
Raw Normal View History

2023-09-12 08:44:05 -06:00
{ config
, lib
, ...
2023-07-11 09:12:50 -06:00
}:
2022-08-25 12:21:35 -06:00
with lib; {
options = {
2023-09-12 08:44:05 -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-12 08:44:05 -06:00
hostNames = [ "pcake" "pcake.tapenet.org" "10.6.0.202" ];
2023-07-11 09:12:50 -06:00
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-12 08:44:05 -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
2023-09-12 08:44:05 -06:00
distributedBuilds = true;
extraOptions = ''
builders-use-substitutes = true
'';
};
2022-08-25 12:21:35 -06:00
};
}