From 3f091c5a789a1203658d1ceaf9d6a476dd2a83c1 Mon Sep 17 00:00:00 2001 From: Hongrui Fang Date: Fri, 23 Aug 2024 22:12:08 +0800 Subject: [PATCH] more runner instances --- hosts/Persephone/github-runners.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/hosts/Persephone/github-runners.nix b/hosts/Persephone/github-runners.nix index 5fd04cb..f629bfb 100644 --- a/hosts/Persephone/github-runners.nix +++ b/hosts/Persephone/github-runners.nix @@ -1,8 +1,19 @@ -{config, ...}: { - services.github-runners.chfanghr-dotfiles-v2 = { - tokenFile = config.age.secrets."github-runner-token-chfanghr-dotfiles-v2".path; - url = "https://github.com/chfanghr/dotfiles-v2"; - }; +{ + config, + lib, + ... +}: let + inherit (lib) range nameValuePair optionalString; + inherit (builtins) listToAttrs map toString; +in { + services.github-runners = listToAttrs (map (i: let + name = "chfanghr-dotfiles-v2${optionalString (i != 0) "-${toString i}"}"; + in + nameValuePair name + { + tokenFile = config.age.secrets."github-runner-token-chfanghr-dotfiles-v2".path; + url = "https://github.com/chfanghr/dotfiles-v2"; + }) (range 0 10)); age.secrets."github-runner-token-chfanghr-dotfiles-v2".file = ../../secrets/github-runner-token-chfanghr-dotfiles-v2.age; }