This commit is contained in:
commit
fef2377502
174 changed files with 7423 additions and 0 deletions
8
nixos-modules/qois/git-ci-runner/README.md
Normal file
8
nixos-modules/qois/git-ci-runner/README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Git CI Runner
|
||||
|
||||
Runner for the [Forgejo git instance](../git/README.md).
|
||||
Currently registers a default runner with ubuntu OS.
|
||||
|
||||
## Create Secret Token
|
||||
|
||||
To create a new token for registration, follow the steps outlined in the [Forgejo documentation](https://forgejo.org/docs/latest/user/actions/#forgejo-runner).
|
52
nixos-modules/qois/git-ci-runner/default.nix
Normal file
52
nixos-modules/qois/git-ci-runner/default.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.qois.git-ci-runner;
|
||||
defaultInstanceName = "default";
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.qois.git-ci-runner = {
|
||||
enable = mkEnableOption "Enable qois git ci-runner service";
|
||||
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "git.qo.is";
|
||||
description = "Domain, under which the service is served.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
sops.secrets."forgejo/runner-token/${defaultInstanceName}".restartUnits = [
|
||||
"gitea-runner-${defaultInstanceName}.service"
|
||||
];
|
||||
|
||||
services.gitea-actions-runner = {
|
||||
package = pkgs.forgejo-runner;
|
||||
instances.${defaultInstanceName} = {
|
||||
enable = true;
|
||||
name = "${config.networking.hostName}-${defaultInstanceName}";
|
||||
url = "https://${cfg.domain}";
|
||||
tokenFile = config.sops.secrets."forgejo/runner-token/${defaultInstanceName}".path;
|
||||
labels = [
|
||||
"ubuntu-latest:docker://gitea/runner-images:ubuntu-latest"
|
||||
"ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04"
|
||||
"docker:docker://code.forgejo.org/oci/alpine:3.20"
|
||||
];
|
||||
settings = {
|
||||
log.level = "warn";
|
||||
runner = {
|
||||
capacity = 30;
|
||||
};
|
||||
cache.enable = true; # TODO: This should probably be a central cache server?
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue