server: add forgjo initial configuration

This commit is contained in:
ooks-io 2024-10-31 22:42:23 +11:00
parent 6360a976f2
commit 331a15f0e6
2 changed files with 34 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{
imports = [
./website
./forgejo
];
}

View file

@ -0,0 +1,33 @@
{
config,
lib,
...
}: let
inherit (config.ooknet.server) services domain;
inherit (lib) mkIf elem;
in {
config = mkIf (elem "forgejo" services) {
ooknet.server = {
webserver.caddy.enable = true;
database.postgresql.enable = true;
};
services = {
forgejo = {
enable = true;
settings = {
server = {
DOMAIN = "git.${domain}";
ROOT_URL = "https://git.${domain}";
HTTP_PORT = 3000;
};
};
};
caddy.virtualHosts = {
"git.${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:3000
'';
};
};
};
}