summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-08-29 16:02:56 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-08-29 16:05:20 -0500
commite1f1e1510ca7f2bc503625c0d4c67a59e881c20b (patch)
tree1b0212bc0ada49a3ae92b3ad19332b3935c4cfa1 /modules
parent25f78ac6dd3b097728936f8675535603789b83a5 (diff)
downloadnixos-config-e1f1e1510ca7f2bc503625c0d4c67a59e881c20b.tar.gz
nixos-config-e1f1e1510ca7f2bc503625c0d4c67a59e881c20b.zip
modules/build-machines: Add remote builders and enable on tomato
Diffstat (limited to 'modules')
-rw-r--r--modules/build-machines.nix32
-rw-r--r--modules/default.nix1
2 files changed, 33 insertions, 0 deletions
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
];