diff --git a/module.nix b/module.nix index 1547a99..e9e663a 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; @@ -119,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 = @@ -376,9 +398,10 @@ in nix = { buildMachines = [ { + inherit (cfg) speedFactor; hostName = sshHost; maxJobs = cfg.cores; - protocol = "ssh-ng"; + protocol = cfg.sshProtocol; supportedFeatures = [ "benchmark" "big-parallel"