niksos/hosts/chmura/services/forgejo.nix

87 lines
2.6 KiB
Nix
Raw Normal View History

2023-10-03 19:22:24 +02:00
{
config,
pkgs,
2023-10-03 19:22:24 +02:00
...
}: {
age.secrets.forgejo-runner-token.file = ../../../secrets/forgejo-runner-token.age;
services = {
forgejo = {
2023-10-03 19:22:24 +02:00
enable = true;
lfs.enable = true;
database.type = "postgres";
dump = {
enable = true;
type = "tar.xz";
2023-10-03 19:22:24 +02:00
};
settings = {
DEFAULT = {
APP_NAME = "fuck it we code";
};
2023-10-03 19:22:24 +02:00
server = rec {
DOMAIN = "git.jacekpoz.pl";
HTTP_PORT = 1849;
PROTOCOL = "http";
SSH_PORT = 8236;
ROOT_URL = "${PROTOCOL}://${DOMAIN}/";
};
service = {
DISABLE_REGISTRATION = true;
};
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "https://code.forgejo.org";
};
federation = {
ENABLED = true;
};
};
};
gitea-actions-runner = {
package = pkgs.forgejo-runner;
instances = {
chmura = {
enable = true;
name = config.networking.hostName;
url = "http://localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}";
tokenFile = config.age.secrets.forgejo-runner-token.path;
labels = [
"native:host"
];
hostPackages = with pkgs; [
nix
nodejs
git
bash
fd
ripgrep
];
settings = {
log.level = "info";
runner = {
file = ".runner";
capacity = 2;
timeout = "3h";
insecure = false;
fetch_timeout = "5s";
fetch_interval = "2s";
};
};
};
2023-10-03 19:22:24 +02:00
};
};
};
systemd.services.gitea-runner-chmura.serviceConfig = {
ReadWritePaths = "/srv/web";
};
2023-10-03 19:22:24 +02:00
services.caddy = {
enable = true;
virtualHosts."git.jacekpoz.pl".extraConfig = ''
2024-03-06 19:05:39 +01:00
reverse_proxy * localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}
2023-10-03 19:22:24 +02:00
'';
};
}