infrastructure/machines/storage01/forgejo.nix
Tom Hubrecht 4716f8a398
All checks were successful
build configuration / build_compute01 (push) Successful in 1m6s
build configuration / build_storage01 (push) Successful in 44s
build configuration / build_web01 (push) Successful in 57s
npins update / npins_update (push) Successful in 46s
feat(modules): Replace dgn-secrets by age-secrets
2024-01-09 14:48:33 +01:00

81 lines
1.6 KiB
Nix

{ pkgs, ... }:
let
port = 3000;
host = "git.dgnum.eu";
in {
services = {
forgejo = {
enable = true;
user = "git";
package = pkgs.forgejo;
stateDir = "/var/lib/git";
database = {
type = "postgres";
user = "git";
name = "git";
};
settings = {
DEFAULT = { APP_NAME = "Forge git de la DGNum"; };
server = {
ROOT_URL = "https://${host}/";
DOMAIN = host;
HTTP_ADDRESS = "127.0.0.1";
HTTP_PORT = port;
APP_DATA_PATH = "/var/lib/git/data";
};
service = {
EMAIL_DOMAIN_ALLOWLIST = "dgnum.eu,*";
DISABLE_REGISTRATION = false;
};
log.LEVEL = "Warn";
ui.THEMES = "forgejo-auto,forgejo-light,forgejo-dark";
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "https://gitea.com";
};
mailer = {
ENABLED = false;
FROM = "git@infra.dgnum.eu";
MAILER_TYPE = "smtp";
SMTP_ADDR = "kurisu.lahfa.xyz";
SMTP_PORT = 465;
IS_TLS_ENABLED = true;
USER = "web-services@infra.dgnum.eu";
};
};
};
nginx = {
enable = true;
virtualHosts.${host} = {
enableACME = true;
forceSSL = true;
locations."/" = { proxyPass = "http://127.0.0.1:${toString port}"; };
};
};
};
users.users.git = {
description = "Git Service";
home = "/var/lib/git";
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
users.groups.git = { };
age-secrets.matches."^forgejo-.*$" = { owner = "git"; };
}