This commit is contained in:
Sridhar Ratnakumar 2024-03-27 10:42:25 -04:00
parent 729867c326
commit f4dc4786bc
3 changed files with 56 additions and 1 deletions

4
.envrc
View file

@ -1 +1,3 @@
use flake
watch_file \
clusters/github-runner/flake-module.nix
use flake

View file

@ -0,0 +1,48 @@
{ self, lib, flake-parts-lib, ... }:
let
inherit (flake-parts-lib)
mkPerSystemOption;
inherit (lib)
types;
in
{
options.distributed-github-runner = {
# TODO: Move to personal-repos?
tokenFile = lib.mkOption {
type = types.string;
description = "The file containing the GitHub runner token";
};
runner-user = lib.mkOption {
type = types.string;
description = "The user to run the GitHub runner as";
default = "github-runner";
};
runner-packages = lib.mkOption {
type = types.listOf types.package;
description = "Packages to install on the GitHub runners";
default = [ ];
};
# NOTE: At some point, we want to support organization repositories as well.
personal-repos = lib.mkOption {
type = types.attrsOf (types.attrsOf (types.submodule {
options = {
num = lib.mkOption {
type = types.int;
description = "The number of runners to register for this repository";
default = 1;
};
};
}));
description = "List of personal repositories to register the runner for";
default = { };
};
outputs = {
nixosModule = lib.mkOption {
type = types.deferredModule;
description = "The NixOS module to use for the GitHub runner";
internal = true;
};
};
};
}

View file

@ -42,8 +42,13 @@
./home
./nixos
./nix-darwin
./clusters/github-runner/flake-module.nix
];
distributed-github-runner = {
tokenFile = "/run/keys/github-runner-token.secret";
};
# Colmena deployment configuration
# See https://github.com/juspay/colmena-flake
colmena-flake.deployment =