From 376a62e9cf87538a91209ceff5a173bffd2e1cda Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 18 Oct 2024 16:48:34 -0500 Subject: [PATCH] Use the remote builders --- modules/baseline.nix | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/baseline.nix b/modules/baseline.nix index 1538c88..98f497a 100644 --- a/modules/baseline.nix +++ b/modules/baseline.nix @@ -1,4 +1,12 @@ -{ pkgs, ... }: +{ + pkgs, + config, + lib, + ... +}: +let + builderHosts = [ "myself" ]; +in { # Enable flakes nix = { @@ -32,8 +40,38 @@ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; + + buildMachines = ( + lib.map (host: { + hostName = "${host}-builder"; + system = "x86_64-linux"; + protocol = "ssh-ng"; + maxJobs = 12; + speedFactor = 2; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; + }) (lib.filter (x: x != config.networking.hostName) builderHosts) + ); + distributedBuilds = true; + extraOptions = '' + builders-use-substitutes = true + ''; }; + programs.ssh.extraConfig = ( + builtins.concatStringsSep "\n" ( + lib.map (x: '' + Host ${x}-builder + Hostname ${x}.home + User remote-builder-user + '') builderHosts + ) + ); + nixpkgs.config = { allowUnfree = true; permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];