From e57a1ae1e04bf44291c84be1f43d6db4a0ac2d36 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 10 May 2025 15:40:30 -0500 Subject: [PATCH 1/2] Add speedFactor option for builder configuration This allows configuring the relative speed factor in nix.buildMachines for the rosetta-builder, affecting how Nix distributes build tasks when multiple build machines are available. --- module.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/module.nix b/module.nix index 1547a99..6b03022 100644 --- a/module.nix +++ b/module.nix @@ -45,6 +45,16 @@ in ''; }; + speedFactor = mkOption { + type = types.int; + default = 1; + description = '' + The relative speed factor of the builder. + This sets the speed factor in the `nix.buildMachines` specification, + which affects how Nix distributes build tasks to this machine. + ''; + }; + cores = mkOption { type = types.int; default = 8; @@ -376,6 +386,7 @@ in nix = { buildMachines = [ { + inherit (cfg) speedFactor; hostName = sshHost; maxJobs = cfg.cores; protocol = "ssh-ng"; From 94d2ea2da6a600fc97013881d7e0043d375cd5cf Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 10 May 2025 19:04:09 -0500 Subject: [PATCH 2/2] Add configurable SSH protocol option Adds a new sshProtocol option that allows selecting between 'ssh' (legacy) and 'ssh-ng' (default) protocols for the remote builder connection. This gives users more flexibility when working with different Nix configurations or when troubleshooting connection issues. --- module.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/module.nix b/module.nix index 6b03022..e9e663a 100644 --- a/module.nix +++ b/module.nix @@ -129,6 +129,18 @@ in The SSH port used by the VM. ''; }; + + sshProtocol = mkOption { + type = types.enum [ + "ssh" + "ssh-ng" + ]; + default = "ssh-ng"; + description = '' + The SSH protocol to use for remote builds. + Options are "ssh" (legacy) or "ssh-ng" (newer protocol with better performance). + ''; + }; }; config = @@ -389,7 +401,7 @@ in inherit (cfg) speedFactor; hostName = sshHost; maxJobs = cfg.cores; - protocol = "ssh-ng"; + protocol = cfg.sshProtocol; supportedFeatures = [ "benchmark" "big-parallel"