refactor: decouple runner pkgs

This commit is contained in:
Sridhar Ratnakumar 2024-03-27 10:05:42 -04:00
parent 19c7d3734a
commit 729867c326
2 changed files with 16 additions and 13 deletions

View file

@ -7,6 +7,7 @@ let
group = "github-runner";
tokenFile = "/run/keys/github-runner-token.secret"; # See colmena keys in top-level flake.nix
repos = import ./repos.nix;
runner-pkgs = (import ./runner-pkgs.nix { inherit pkgs lib; });
# Convenient function to create multiple runners per single personal repo.
mkPersonalRunners = user:
lib.concatMapAttrs (repoName: meta:
@ -18,24 +19,12 @@ let
inherit user group tokenFile name;
enable = true;
replace = true;
extraPackages = with pkgs; [
extraPackages = with pkgs; runner-pkgs ++ [
# Standard nix tools
nixci
cachix
# For nixos-flake
sd
# Tools already available in standard GitHub Runners; so we provide
# them here:
coreutils
which
jq
# https://github.com/actions/upload-pages-artifact/blob/56afc609e74202658d3ffba0e8f6dda462b719fa/action.yml#L40
(pkgs.runCommandNoCC "gtar" { } ''
mkdir -p $out/bin
ln -s ${lib.getExe pkgs.gnutar} $out/bin/gtar
'')
];
url = "https://github.com/${user}/${repoName}";
})));

View file

@ -0,0 +1,14 @@
{ pkgs, lib, ... }:
# Tools already available in standard GitHub Runners; so we provide
# them here:
with pkgs; [
coreutils
which
jq
# https://github.com/actions/upload-pages-artifact/blob/56afc609e74202658d3ffba0e8f6dda462b719fa/action.yml#L40
(runCommandNoCC "gtar" { } ''
mkdir -p $out/bin
ln -s ${lib.getExe gnutar} $out/bin/gtar
'')
]