28 lines
737 B
Nix
28 lines
737 B
Nix
|
{configVars, ...}: let
|
||
|
email = configVars.email.user;
|
||
|
domain = configVars.domains.forgejo;
|
||
|
forgejoIp = configVars.networking.addresses.forgejo.localAddress;
|
||
|
forgejoPort = configVars.networking.addresses.forgejo.port;
|
||
|
in {
|
||
|
networking.firewall.allowedTCPPorts = [80 443];
|
||
|
security.acme = {
|
||
|
acceptTerms = true;
|
||
|
defaults.email = email;
|
||
|
};
|
||
|
services.nginx = {
|
||
|
enable = true;
|
||
|
recommendedProxySettings = true;
|
||
|
recommendedTlsSettings = true;
|
||
|
virtualHosts."git.${domain}" = {
|
||
|
enableACME = true;
|
||
|
forceSSL = true;
|
||
|
extraConfig = ''
|
||
|
client_max_body_size 1024M;
|
||
|
'';
|
||
|
locations."/" = {
|
||
|
proxyPass = "http://${forgejoIp}:${toString forgejoPort}";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|