From e1f1e1510ca7f2bc503625c0d4c67a59e881c20b Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Fri, 29 Aug 2025 16:02:56 -0500 Subject: modules/build-machines: Add remote builders and enable on tomato --- modules/build-machines.nix | 32 ++++++++++++++++++++++++++++++++ modules/default.nix | 1 + 2 files changed, 33 insertions(+) create mode 100644 modules/build-machines.nix (limited to 'modules') diff --git a/modules/build-machines.nix b/modules/build-machines.nix new file mode 100644 index 0000000..12409db --- /dev/null +++ b/modules/build-machines.nix @@ -0,0 +1,32 @@ +{lib, config, ...}: + +let + machines = { + pinto = { + maxJobs = 2; + protocol = "ssh-ng"; + supportedFeatures = ["big-parallel" "kvm"]; + }; + }; + enabled = config.this.buildMachines; + + inherit (lib.attrsets) filterAttrs; +in +{ + options = { + this.buildMachines = lib.mkOption { + type = with lib.types; listOf str; + default = []; + }; + }; + + config = { + nix.buildMachines = builtins.map + (m: machines."${m}" // { hostName = m; }) + enabled; + nix.distributedBuilds = (enabled == []); + nix.extraOptions = lib.mkIf (enabled != []) '' + builders-use-substitutes = true + ''; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 36c6f66..06f0fb3 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -14,6 +14,7 @@ ./hosts.nix ./bluetooth.nix ./unfree.nix + ./build-machines.nix ./overlays ]; -- cgit v1.2.3