From 70957ab0c6a37fe72d21e1a2c273189a05c3670c Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Thu, 28 Nov 2024 14:14:25 +1100 Subject: [PATCH] linux-builder: default `maxJobs` to amount of cores for Linux builder --- modules/nix/linux-builder.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/nix/linux-builder.nix b/modules/nix/linux-builder.nix index 2bcb62ea..ae39547f 100644 --- a/modules/nix/linux-builder.nix +++ b/modules/nix/linux-builder.nix @@ -61,9 +61,16 @@ in maxJobs = mkOption { type = types.ints.positive; - default = 1; - example = 4; + default = cfg.package.nixosConfig.virtualisation.cores; + defaultText = '' + The `virtualisation.cores` of the build machine's final NixOS configuration. + ''; + example = 2; description = '' + Instead of setting this directly, you should set + {option}`nix.linux-builder.config.virtualisation.cores` to configure + the amount of cores the Linux builder should have. + The number of concurrent jobs the Linux builder machine supports. The build machine will enforce its own limits, but this allows hydra to schedule better since there is no work-stealing between build