forgejo actions!!!!!!!!

This commit is contained in:
Jill 2023-06-08 22:50:51 +02:00
parent a1f413b045
commit 623d4040a5
2 changed files with 20 additions and 0 deletions

View File

@ -28,6 +28,7 @@ in {
enable = true; enable = true;
domain = "git.oat.zone"; domain = "git.oat.zone";
port = 3000; port = 3000;
enableActions = true;
}; };
matrix.conduit = { matrix.conduit = {

View File

@ -21,9 +21,15 @@ in {
type = types.package; type = types.package;
default = pkgs.unstable.forgejo; default = pkgs.unstable.forgejo;
}; };
enableActions = mkOption {
type = types.bool;
default = false;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
virtualisation.docker.enable = cfg.enableActions;
services = { services = {
gitea = { gitea = {
enable = true; enable = true;
@ -44,9 +50,22 @@ in {
HTTP_PORT = cfg.port; HTTP_PORT = cfg.port;
ROOT_URL = "https://${cfg.domain}/"; ROOT_URL = "https://${cfg.domain}/";
}; };
"actions" = {
ENABLED = cfg.enableActions;
};
}]; }];
}; };
gitea-actions-runner = mkIf cfg.enableActions {
instances."#{config.networking.hostName}" = {
enable = true;
name = "ci";
url = "https://${cfg.domain}/";
labels = []; # use the packaged instance list
token = removeSuffix "\n" (builtins.readFile "/etc/forgejo-runner-token");
};
};
nginx.virtualHosts."${cfg.domain}" = { nginx.virtualHosts."${cfg.domain}" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;