nixos-configs/devices/oksys/modules/remote-builder.nix
matt1432 ebd34a9481
All checks were successful
Discord / discord commits (push) Has been skipped
feat(oksys): add servivi as remote builder
2023-12-29 17:37:48 -05:00

37 lines
1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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