dotfiles/flakes/common/nix_modules/remote_lio_builds.nix
RingOfStorms (Joshua Bell) 3cb6fba59e make all age use conditional
2025-10-27 23:03:40 -05:00

44 lines
948 B
Nix

{
config,
lib,
...
}:
let
hasSecret =
secret:
let
secrets = config.age.secrets or { };
in
secrets ? ${secret} && secrets.${secret} != null;
in
{
# Remote build off home lio computer
programs.ssh.extraConfig = lib.mkIf (hasSecret "nix2lio") ''
Host lio_
PubkeyAcceptedKeyTypes ssh-ed25519
ServerAliveInterval 60
IPQoS throughput
IdentityFile ${config.age.secrets.nix2lio.path}
'';
nix = lib.mkIf (hasSecret "nix2lio") {
distributedBuilds = true;
buildMachines = [
{
# TODO require hostname in ssh config?
hostName = "lio_";
system = "x86_64-linux";
protocol = "ssh-ng";
maxJobs = 32;
speedFactor = 2;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
"uid-range" # Often helpful
];
mandatoryFeatures = [ ];
}
];
};
}