Gitea: Prepare for with domain

master
David Crompton 2023-08-29 11:59:58 -04:00
parent 467b6f6445
commit 5ecd8a3b5d
1 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
{ pkgs, config, ...}: let
# Domain TBD
domain = "git.kcnhub.syzygial.cc";
in {
services.gitea = {
enable = true;
database = {
type = "postgres";
socket = "/run/postgresql";
};
settings = {
server = {
HTTP_PORT = 5000;
ROOT_URL = "https://git.${davesDomain}";
};
actions = {
ENABLED = true;
};
};
};
# Services Runner running in nixos-container w/ host label
# This allows sharing of nix-store for caching actions builds
# ... Maybe I'll actually set this up. Some concern for clearing its
# cache and it overpopulating. Idk. We'll see.
# services.gitea-actions-runner.instances."nix-runner" = {
# enable = true;
# name = "nix-runner";
# url = "http://localhost:${config.services.gitea.settings.server.HTTP_PORT}";
# labels = [
# # don't require docker/podman
# "native:host"
# ];
# tokenFile = "/var/lib/gitea/runner_token";
# };
services.postgresql = {
enable = true;
port = 5432;
ensureUsers = [{
name = "gitea";
ensurePermissions = {
"DATABASE \"gitea\"" = "ALL PRIVILEGES";
};
ensureClauses = {
createdb = true;
};
}];
};
services.caddy.virtualHosts = {
"${domain}" = {
extraConfig = ''
reverse_proxy 127.0.0.1:${toString config.services.gitea.settings.server.HTTP_PORT}
'';
};
};
}