nixos-config/modules/nixos/forgejo-actions-runner.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2024-08-25 09:45:58 +00:00
{
config,
pkgs,
lib,
...
}:
2024-03-25 17:56:59 +00:00
let
cfg = config.custom.forgejo-actions-runner;
2024-11-12 13:27:57 +00:00
settingsFormat = pkgs.formats.yaml { };
2024-03-25 17:56:59 +00:00
in
{
options = {
custom.forgejo-actions-runner = {
enable = lib.mkEnableOption "TPM supported ssh agent in go";
2024-08-25 09:45:58 +00:00
tokenFile = lib.mkOption { type = lib.types.path; };
2024-11-12 13:27:57 +00:00
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = settingsFormat.type;
};
default = { };
};
2024-03-25 17:56:59 +00:00
};
};
config = lib.mkIf cfg.enable {
virtualisation.docker.enable = true;
services.gitea-actions-runner.package = pkgs.forgejo-actions-runner;
services.gitea-actions-runner.instances = {
"git.xinyang.life" = {
enable = true;
url = "https://git.xinyang.life";
tokenFile = cfg.tokenFile;
name = config.networking.hostName;
labels = [
"debian-latest:docker://node:18-bullseye"
"ubuntu-latest:docker://node:18-bullseye"
"nix:docker://xiny/nix-runner:2.21.0-pkgs-23.11"
];
settings = {
container.network = "host";
2024-11-12 13:27:57 +00:00
} // cfg.settings;
2024-03-25 17:56:59 +00:00
};
};
};
}