54 lines
1.5 KiB
Nix
54 lines
1.5 KiB
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
{
|
||
|
services.gitea = {
|
||
|
enable = true;
|
||
|
appName = "Sealight Git Forge";
|
||
|
domain = "git.sealight.xyz";
|
||
|
rootUrl = "https://git.sealight.xyz";
|
||
|
httpPort = 3001;
|
||
|
database = {
|
||
|
type = "postgres";
|
||
|
# passwordFile = "/run/secrets/gitea-dbpass"; # supplied by agenix
|
||
|
password = "somethingunknowablesorry";
|
||
|
};
|
||
|
settings = {
|
||
|
metrics = {
|
||
|
ENABLED = true;
|
||
|
};
|
||
|
repository = {
|
||
|
DEFAULT_BRANCH = "main";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
services.postgresql = {
|
||
|
enable = true; # Ensure postgresql is enabled
|
||
|
authentication = ''
|
||
|
local gitea all ident map=gitea-users
|
||
|
'';
|
||
|
identMap = # Map the gitea user to postgresql
|
||
|
''
|
||
|
gitea-users gitea gitea
|
||
|
'';
|
||
|
# ensureDatabases = [ "gitea" ];
|
||
|
# ensureUsers = [
|
||
|
# { name = "gitea"; ensurePermissions."DATABASE gitea" = "ALLPRIVLEGES"; }
|
||
|
# ];
|
||
|
};
|
||
|
|
||
|
services.nginx = {
|
||
|
enable = true; # Enable Nginx
|
||
|
recommendedGzipSettings = true;
|
||
|
recommendedOptimisation = true;
|
||
|
recommendedProxySettings = true;
|
||
|
recommendedTlsSettings = true;
|
||
|
virtualHosts."git.sealight.xyz" = { # Gitea hostname
|
||
|
enableACME = true; # Use ACME certs
|
||
|
forceSSL = true; # Force SSL
|
||
|
locations."/".proxyPass = "http://localhost:3001/"; # Proxy Gitea
|
||
|
};
|
||
|
};
|
||
|
}
|