feat(home-server): add forgejo

This commit is contained in:
Felix Schröter 2025-01-17 13:34:14 +01:00
parent 06b202857c
commit e45c34c465
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 47 additions and 0 deletions

View file

@ -29,6 +29,7 @@ in
../services/mail.nix ../services/mail.nix
../services/lldap.nix ../services/lldap.nix
../services/authelia.nix ../services/authelia.nix
../services/forgejo
../services/restic/home-server.nix ../services/restic/home-server.nix
../services/samba/home-server.nix ../services/samba/home-server.nix
# ../services/kodi.nix # ../services/kodi.nix
@ -89,6 +90,7 @@ in
"openpgpkey.felschr.com" "openpgpkey.felschr.com"
"ldap.felschr.com" "ldap.felschr.com"
"auth.felschr.com" "auth.felschr.com"
"git.felschr.com"
"home.felschr.com" "home.felschr.com"
"esphome.felschr.com" "esphome.felschr.com"
"matrix.felschr.com" "matrix.felschr.com"

View file

@ -0,0 +1,45 @@
{ config, pkgs, ... }:
let
domain = "git.felschr.com";
sshPort = 2222;
in
{
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = {
DOMAIN = domain;
PROTOCOL = "http+unix";
ROOT_URL = "https://${domain}/";
START_SSH_SERVER = true;
SSH_PORT = sshPort;
SSH_LISTEN_PORT = sshPort;
};
service.DISABLE_REGISTRATION = true;
ui = {
DEFAULT_THEME = "forgejo-dark";
};
mailer = {
ENABLED = true;
PROTOCOL = "sendmail";
FROM = config.programs.msmtp.accounts.default.from;
SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
SENDMAIL_ARGS = "--";
};
};
};
networking.firewall.allowedTCPPorts = [ sshPort ];
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://unix:${cfg.settings.server.HTTP_ADDR}";
};
}