2024-04-10 01:05:38 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
let
|
2024-05-06 22:25:35 +02:00
|
|
|
vivariumBuilderDefault = {
|
2024-05-06 22:50:01 +02:00
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
2024-05-06 22:25:35 +02:00
|
|
|
protocol = "ssh-ng";
|
|
|
|
sshUser = "nixremote";
|
|
|
|
# sshKey doesn't work
|
|
|
|
};
|
2024-05-07 00:00:36 +02:00
|
|
|
# MANU ssh-keygen -y -f /etc/ssh/ssh_host_ed25519_key | base64 -w0
|
2024-05-06 22:25:35 +02:00
|
|
|
vivariumBuilders = [
|
|
|
|
{
|
|
|
|
hostName = "abavorana.frogeye.fr";
|
2024-05-07 00:00:36 +02:00
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU5iNzcrS01tRHI0MVhZdmZITXQvK3NHMkJCSEIzYUl4M045WDNVejhFaUogZ2VvZmZyZXlAY3VyYWNhbwo=";
|
2024-05-06 22:25:35 +02:00
|
|
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
2024-05-09 23:13:08 +02:00
|
|
|
maxJobs = 8;
|
2024-05-06 22:25:35 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
hostName = "ludwig.clowncar.frogeye.fr";
|
2024-05-07 00:00:36 +02:00
|
|
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU41SXZhMzNXeGplN095cHVEUHBSakFNMTlvRUtEVDRiYlpUTm82V1FLZTAgZ2VvZmZyZXlAY3VyYWNhbwo=";
|
2024-05-09 23:13:08 +02:00
|
|
|
maxJobs = 4;
|
2024-05-06 22:25:35 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
# MANU pass vivarium/lemmy/remote-builds/cache | nix key convert-secret-to-public | cat
|
2024-04-10 01:05:38 +02:00
|
|
|
publicKeys = [
|
|
|
|
"abavorana.frogeye.fr:rcKZ9gwaIQLcst/vbhbF7meUQD5sveT2QQN4a+Zo1BM="
|
|
|
|
"ludwig.clowncar.frogeye.fr:jTlN0fCOLU49M3LQw5j/u++Gmwrsv3m9RGs0slSg6r0="
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = {
|
2024-06-26 02:16:50 +02:00
|
|
|
system.activationScripts.remote = {
|
2024-05-06 22:25:35 +02:00
|
|
|
supportsDryActivation = true;
|
|
|
|
text = ''
|
|
|
|
mkdir -p /root/.ssh
|
|
|
|
cat ${pkgs.writeText "root-ssh-config" (lib.strings.concatLines (builtins.map (builder: ''
|
|
|
|
Host ${builder.hostName}
|
2024-05-09 23:07:51 +02:00
|
|
|
ControlMaster auto
|
|
|
|
ControlPath ~/.ssh/master-%r@%n:%p
|
|
|
|
ControlPersist 60s
|
2024-05-06 22:25:35 +02:00
|
|
|
'') vivariumBuilders)) } > /root/.ssh/config
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
nix = {
|
|
|
|
buildMachines = builtins.map (vivariumBuilder: vivariumBuilderDefault // vivariumBuilder) vivariumBuilders;
|
2024-05-10 14:50:02 +02:00
|
|
|
distributedBuilds = false;
|
2024-05-06 22:25:35 +02:00
|
|
|
settings = {
|
|
|
|
builders-use-substitutes = true;
|
|
|
|
trusted-public-keys = publicKeys;
|
2024-05-10 14:50:02 +02:00
|
|
|
trusted-substituters = builtins.map (builder: "${builder.protocol}://${builder.sshUser}@${builder.hostName}") config.nix.buildMachines;
|
2024-05-06 22:25:35 +02:00
|
|
|
};
|
2024-04-10 01:05:38 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|