2023-12-04 12:43:57 +01:00
|
|
|
{ pkgs, ... }:
|
2023-07-24 09:50:57 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
port = 3000;
|
|
|
|
host = "git.dgnum.eu";
|
2023-09-14 19:27:01 +02:00
|
|
|
in {
|
2023-11-29 20:31:16 +01:00
|
|
|
services = {
|
|
|
|
forgejo = {
|
|
|
|
enable = true;
|
2023-07-24 09:50:57 +02:00
|
|
|
|
|
|
|
user = "git";
|
2023-11-29 20:31:16 +01:00
|
|
|
package = pkgs.forgejo;
|
|
|
|
stateDir = "/var/lib/git";
|
2023-09-24 13:27:37 +02:00
|
|
|
|
2023-11-29 20:31:16 +01:00
|
|
|
database = {
|
|
|
|
type = "postgres";
|
|
|
|
user = "git";
|
|
|
|
name = "git";
|
2023-07-24 09:50:57 +02:00
|
|
|
};
|
|
|
|
|
2023-11-29 20:31:16 +01:00
|
|
|
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 = {
|
2023-12-04 12:43:57 +01:00
|
|
|
EMAIL_DOMAIN_ALLOWLIST = "dgnum.eu,*";
|
2023-11-29 20:31:16 +01:00
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
2023-07-24 09:50:57 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-29 20:31:16 +01:00
|
|
|
nginx = {
|
|
|
|
enable = true;
|
2023-07-24 09:50:57 +02:00
|
|
|
|
2023-11-29 20:31:16 +01:00
|
|
|
virtualHosts.${host} = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = { proxyPass = "http://127.0.0.1:${toString port}"; };
|
|
|
|
};
|
2023-07-24 09:50:57 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.git = {
|
|
|
|
description = "Git Service";
|
|
|
|
home = "/var/lib/git";
|
|
|
|
useDefaultShell = true;
|
|
|
|
group = "git";
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups.git = { };
|
|
|
|
|
2024-01-09 14:48:33 +01:00
|
|
|
age-secrets.matches."^forgejo-.*$" = { owner = "git"; };
|
2023-07-24 09:50:57 +02:00
|
|
|
}
|