feat (hosts/mystra)!: attempt at forgejo server

This commit is contained in:
Henri Saudubray 2026-02-18 10:24:42 +01:00
parent 57fad610ad
commit 31ed4c0c5f
Signed by: hms
GPG key ID: 7065F57ED8856128
2 changed files with 32 additions and 0 deletions

View file

@ -6,6 +6,7 @@
../../nixos/server.nix
./nginx.nix
./taskd.nix
./forgejo.nix
];
networking.firewall.allowedTCPPorts = [

31
hosts/mystra/forgejo.nix Normal file
View file

@ -0,0 +1,31 @@
{ lib, config, ... }:
let
cfg = config.settings.forgejo;
srv = cfg.settings.server;
in
{
services.nginx.virtualHosts."git.henri-saudubray.fr" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.henri-saudubray.fr";
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 3000;
SSH_PORT = lib.head config.services.openssh.ports;
};
service.DISABLE_REGISTRATION = true;
};
};
}