2022-10-12 19:43:24 +01:00
|
|
|
{config, ...}: let
|
|
|
|
domain = "gitea.${config.services.nginx.domain}";
|
|
|
|
in {
|
|
|
|
services.gitea = {
|
|
|
|
inherit domain;
|
|
|
|
enable = true;
|
2021-04-12 01:41:31 +01:00
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
httpAddress = "127.0.0.1";
|
|
|
|
database.type = "postgres";
|
2021-04-12 01:41:31 +01:00
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
ssh.clonePort = 2222;
|
|
|
|
rootUrl = "https://${domain}/";
|
|
|
|
cookieSecure = true;
|
2021-04-12 01:41:31 +01:00
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
appName = "Gitea: Git with a cup of tea";
|
|
|
|
disableRegistration = true;
|
|
|
|
};
|
2021-04-28 23:02:27 +01:00
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
# Set up SSL
|
|
|
|
services.nginx.virtualHosts."${domain}" = let
|
|
|
|
inherit (config.services.gitea) httpAddress httpPort;
|
|
|
|
in {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
extraConfig = ''
|
|
|
|
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
|
|
|
'';
|
2021-04-12 01:41:31 +01:00
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
locations."/".proxyPass = "http://${httpAddress}:${toString httpPort}";
|
2021-04-12 01:41:31 +01:00
|
|
|
};
|
|
|
|
}
|