camelot: Add forgejo

This commit is contained in:
Victor Mignot 2024-07-27 10:22:22 +02:00
parent 774fc961e2
commit 67acb4e852
Signed by: dala
GPG key ID: 5E7F2CE1BEAFED3D
2 changed files with 52 additions and 0 deletions

View file

@ -44,6 +44,7 @@
./nextcloud.nix
./gotosocial.nix
./matrix.nix
./forgejo.nix
];
swapDeviceUUID = "a7c628ab-c5cb-4094-89d0-19b153fbead4";

View file

@ -0,0 +1,51 @@
{ config, ... }:
let
forgejoUrl = "git.dalaran.fr";
forgejoPort = config.services.forgejo.settings.server.HTTP_PORT;
in
{
services.nginx.virtualHosts.${forgejoUrl} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:${toString forgejoPort}";
};
};
services.forgejo = {
enable = true;
database = {
type = "postgres";
createDatabase = true;
};
stateDir = "/srv/forgejo";
dump.enable = true;
lfs.enable = true;
settings = {
DEFAULT = {
APP_NAME = "Dala's Git server";
};
server = {
DOMAIN = forgejoUrl;
ROOT_URL = "https://${forgejoUrl}";
HTTP_ADDR = "127.0.0.1";
LANDING_PAGE = "/dala";
};
session = {
COOKIE_SECURE = true;
};
service = {
DISABLE_REGISTRATION = true;
};
};
};
}