mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
wip
This commit is contained in:
parent
729867c326
commit
f4dc4786bc
3 changed files with 56 additions and 1 deletions
4
.envrc
4
.envrc
|
|
@ -1 +1,3 @@
|
|||
use flake
|
||||
watch_file \
|
||||
clusters/github-runner/flake-module.nix
|
||||
use flake
|
||||
|
|
|
|||
48
clusters/github-runner/flake-module.nix
Normal file
48
clusters/github-runner/flake-module.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue