2023-12-29 17:37:48 -05:00
|
|
|
|
{config, ...}: let
|
|
|
|
|
servivi = "100.64.0.7";
|
|
|
|
|
in {
|
2023-12-30 00:06:27 -05:00
|
|
|
|
# https://nixos.wiki/wiki/Distributed_build
|
2023-12-29 17:37:48 -05:00
|
|
|
|
home-manager.users.root = {
|
2024-01-08 11:25:18 -05:00
|
|
|
|
home.file.".ssh/config".text =
|
|
|
|
|
/*
|
|
|
|
|
ssh_config
|
|
|
|
|
*/
|
|
|
|
|
''
|
|
|
|
|
Host ${servivi}
|
|
|
|
|
# Prevent using ssh-agent or another keyfile, useful for testing
|
|
|
|
|
IdentitiesOnly yes
|
|
|
|
|
IdentityFile ${config.sops.secrets.nixremote.path}
|
2023-12-29 17:37:48 -05:00
|
|
|
|
|
2024-01-08 11:25:18 -05:00
|
|
|
|
# The weakly privileged user on the remote builder – if not set, 'root' is used – which will hopefully fail
|
|
|
|
|
User nixremote
|
|
|
|
|
'';
|
2023-12-29 17:37:48 -05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.ssh.knownHosts = {
|
|
|
|
|
${servivi}.publicKey = "servivi ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkNW0H4Fl6NFgahlgGbSvglg1DrX4yl1ht9Lp+vHE2A";
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-30 00:06:27 -05:00
|
|
|
|
nix = {
|
|
|
|
|
buildMachines = [
|
|
|
|
|
{
|
|
|
|
|
hostName = servivi;
|
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
protocol = "ssh-ng";
|
|
|
|
|
maxJobs = 1;
|
|
|
|
|
speedFactor = 2;
|
|
|
|
|
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
|
|
|
|
|
mandatoryFeatures = [];
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
distributedBuilds = true;
|
|
|
|
|
# optional, useful when the builder has a faster internet connection than yours
|
|
|
|
|
extraOptions = ''
|
|
|
|
|
builders-use-substitutes = true
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-12-29 17:37:48 -05:00
|
|
|
|
}
|