server-configuration/services/forgejo.nix
2025-03-27 15:07:32 +01:00

50 lines
1.1 KiB
Nix
Executable file

{...}: let
host = "127.0.0.1";
port = 6969;
in {
services.forgejo = {
enable = true;
lfs.enable = true;
database.type = "postgres";
settings = {
DEFAULT = {
APP_NAME = "An idiot admires complexity. A genius admires simplicity";
};
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
server = {
DOMAIN = "git.spoodythe.one";
HTTP_PORT = port;
ROOT_URL = "https://git.spoodythe.one";
};
service.DISABLE_REGISTRATION = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "https://code.forgejo.org";
};
federation.ENABLED = false;
};
};
services.nginx.virtualHosts."git.spoodythe.one" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${host}:${toString port}";
extraConfig = ''
client_max_body_size 100M;
'';
};
};
# Open port 80 and 443 for reverse proxy
networking.firewall.allowedTCPPorts = [80 443];
networking.firewall.allowedUDPPorts = [80 443];
}