From a83b7b0e0ced3433aa2d8291732451ddb75ec91b Mon Sep 17 00:00:00 2001 From: Lin Yinfeng Date: Tue, 17 Dec 2024 15:20:34 +0800 Subject: [PATCH] nix/hydra-build-client: auto generate systems --- .../nix/hydra-builder-client/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/nixos/profiles/nix/hydra-builder-client/default.nix b/nixos/profiles/nix/hydra-builder-client/default.nix index 80f580fe2..75b54d61c 100644 --- a/nixos/profiles/nix/hydra-builder-client/default.nix +++ b/nixos/profiles/nix/hydra-builder-client/default.nix @@ -1,7 +1,9 @@ -{ config, ... }: +{ config, lib, ... }: let dir = "nix-build-machines/hydra-builder"; keyFile = config.sops.secrets."hydra_builder_private_key".path; + allSystems = lib.concatStringsSep "," config.lib.self.systems; + nonAarch64Systems = lib.concatStringsSep "," (lib.remove "aarch64-linux" config.lib.self.systems); in { nix = { @@ -12,18 +14,18 @@ in }; # https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds environment.etc."${dir}/machines".text = '' - hydra-builder@nuc x86_64-linux,i686-linux,aarch64-linux ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel - hydra-builder@fsn0 aarch64-linux ${keyFile} 2 200 benchmark,big-parallel + hydra-builder@nuc ${allSystems} ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel + hydra-builder@fsn0 aarch64-linux ${keyFile} 2 200 benchmark,big-parallel ''; environment.etc."${dir}/machines-workstation".text = '' - hydra-builder@nuc x86_64-linux,i686-linux ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel - hydra-builder@xps8930 x86_64-linux,i686-linux ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel - hydra-builder@owl x86_64-linux,i686-linux ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel + hydra-builder@nuc ${nonAarch64Systems} ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel + hydra-builder@xps8930 ${nonAarch64Systems} ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel + hydra-builder@owl ${nonAarch64Systems} ${keyFile} 8 100 kvm,nixos-test,benchmark,big-parallel - hydra-builder@fsn0 aarch64-linux ${keyFile} 2 100 benchmark,big-parallel - hydra-builder@nuc aarch64-linux ${keyFile} 8 50 - hydra-builder@xps8930 aarch64-linux ${keyFile} 8 50 - hydra-builder@owl aarch64-linux ${keyFile} 8 50 + hydra-builder@fsn0 aarch64-linux ${keyFile} 2 100 benchmark,big-parallel + hydra-builder@nuc aarch64-linux ${keyFile} 8 50 + hydra-builder@xps8930 aarch64-linux ${keyFile} 8 50 + hydra-builder@owl aarch64-linux ${keyFile} 8 50 ''; sops.secrets."hydra_builder_private_key" = { terraformOutput.enable = true;