nix/modules/services/forgejo/default.nix

39 lines
814 B
Nix
Raw Permalink Normal View History

2024-11-08 18:23:40 +01:00
{
domain,
2024-11-24 20:15:38 +01:00
lib,
config,
2024-11-08 18:23:40 +01:00
...
}: let
2024-10-20 02:34:02 +02:00
cfg = config.services.forgejo;
srv = cfg.settings.server;
in {
2024-11-24 20:15:38 +01:00
options = {
forgejo.enable = lib.mkEnableOption "";
2024-10-20 02:34:02 +02:00
};
2024-11-24 20:15:38 +01:00
config = lib.mkIf config.forgejo.enable {
services.nginx = {
virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
};
2024-10-20 02:34:02 +02:00
2024-11-24 20:15:38 +01:00
services.forgejo = {
enable = true;
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.${domain}";
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 2000;
};
service.DISABLE_REGISTRATION = true;
2024-10-20 02:34:02 +02:00
};
};
};
2024-10-12 21:12:58 +02:00
}