fix: remove sshPort from buildMachines (use SSH config instead)

This commit is contained in:
2026-06-18 17:20:38 -04:00
parent 932de1752d
commit c6fd58123e

View File

@@ -19,7 +19,7 @@ in {
port = lib.mkOption {
type = lib.types.port;
default = 2424;
description = "SSH port on the remote build machine.";
description = "SSH port added via ~root/.ssh/config since nix.buildMachines has no sshPort option.";
};
systems = lib.mkOption {
type = lib.types.listOf lib.types.str;
@@ -50,7 +50,6 @@ in {
nix.buildMachines = [{
hostName = cfg.buildMachine.host;
sshUser = cfg.buildMachine.sshUser;
sshPort = cfg.buildMachine.port;
systems = cfg.buildMachine.systems;
maxJobs = cfg.buildMachine.maxJobs;
supportedFeatures = cfg.buildMachine.supportedFeatures;
@@ -60,5 +59,13 @@ in {
builders-use-substitutes = true
fallback = true
'';
# SSH config for the remote builder (since nix.buildMachines has no port option)
programs.ssh.extraConfig = ''
Host ${cfg.buildMachine.host}
HostName ${cfg.buildMachine.host}
Port ${toString cfg.buildMachine.port}
User ${cfg.buildMachine.sshUser}
'';
};
}