nixos-config/modules/services/server/gitea.nix

93 lines
2.4 KiB
Nix

#
# System notifications
#
{ config, lib, pkgs, ... }:
{
services.gitea = {
enable = true;
dump.enable = true;
rootUrl = "https://git2.kabtop.de";
lfs.enable = true;
httpAddress = "localhost";
dump.type = "tar.xz";
domain = "git2.kabtop.de";
database.type = "postgres";
database.user = "gitea";
database.name = "giteadb"
database.passwordFile = config.age.secrets."services/gitea/databasePassword".path;
appName = "Kabtop Git";
mailerPasswordFile = config.age.secrets."services/gitea/mailerPassword".path;
settings = {
server = {
START_SSH_SERVER = true;
SSH_PORT = 2222;
# SSH_SERVER_CIPHERS = "";
# SSH_SERVER_KEY_EXCHANGES = "";
# SSH_SERVER_MACS = "";
ENABLE_GZIP = true;
};
security = {
MIN_PASSWORD_LENGTH = 8;
PASSWORD_CHECK_PWN = true;
PASSWORD_HASH_ALGO = "argon2";
};
# oauth2 = {
# ENABLE = true;
# #JWT_SECRET = "secret123";
# };
repository = {
MAX_CREATION_LIMIT = 100;
};
ui = {
SHOW_USER_EMAIL = false;
DEFAULT_THEME = "arc-green";
};
# openid = {
# ENABLE_OPENID_SIGNIN = true;
# WHITELISTED_URIS = "https://auth.kabtop.de";
# };
# oauth2_client = {
# ENABLE_AUTO_REGISTRATION = true;
# };
time = {
DEFAULT_UI_LOCATION = "Europe/Berlin";
};
other = {
SHOW_FOOTER_VERSION = false;
};
session.COOKIE_SECURE = true;
service.DISABLE_REGISTRATION = true;
};
extraConfig = ''
[database]
HOST = 127.0.0.1:5432
'';
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"${config.services.gitea.domain}" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:3000";
};
};
age.secrets."services/gitea/mailerPassword" = {
file = ../../../secrets/services/gitea/mailerPassword.age;
owner = "gitea";
};
age.secrets."services/gitea/databasePassword" = {
file = ../../../secrets/services/gitea/databasePassword.age;
owner = "gitea";
};
}