infrastructure/machines/storage01/forgejo.nix

108 lines
2.3 KiB
Nix
Raw Permalink Normal View History

{ config, nixpkgs, ... }:
let
port = 3000;
host = "git.dgnum.eu";
in
{
services = {
forgejo = {
enable = true;
user = "git";
package = nixpkgs.unstable.forgejo;
stateDir = "/var/lib/git";
database = {
type = "postgres";
user = "git";
name = "git";
};
settings = {
DEFAULT = {
APP_NAME = "Forge git de la DGNum";
};
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "https://gitea.com";
};
admin = {
DEFAULT_EMAIL_NOTIFICATIONS = "enabled";
SEND_NOTIFICATION_EMAIL_ON_NEW_USER = true;
};
log.LEVEL = "Warn";
mailer = {
ENABLED = true;
FROM = "git@infra.dgnum.eu";
PROTOCOL = "smtps";
SMTP_ADDR = "kurisu.lahfa.xyz";
SMTP_PORT = 465;
USER = "web-services@infra.dgnum.eu";
};
2024-10-12 19:52:21 +02:00
session = {
SESSION_LIFE_TIME = 24 * 3600 * 7;
GC_INTERVAL_TIME = 24 * 3600 * 7;
};
server = {
ROOT_URL = "https://${host}/";
DOMAIN = host;
HTTP_ADDRESS = "127.0.0.1";
HTTP_PORT = port;
APP_DATA_PATH = "/var/lib/git/data";
2024-06-06 11:24:13 +02:00
OFFLINE_MODE = false;
};
service = {
EMAIL_DOMAIN_ALLOWLIST = "dgnum.eu,*";
ENABLE_NOTIFY_MAIL = true;
DISABLE_REGISTRATION = false;
2024-02-07 10:19:13 +01:00
REGISTER_EMAIL_CONFIRM = true;
};
ui.THEMES = "forgejo-auto,forgejo-light,forgejo-dark";
2024-06-05 12:50:05 +02:00
"cron.cleanup_actions".ENABLED = true;
"cron.delete_old_actions".ENABLED = true;
"cron.git_gc_repos".ENABLED = true;
"cron.update_checker".ENABLED = false;
};
2024-02-07 10:19:13 +01:00
mailerPasswordFile = config.age.secrets."forgejo-mailer_password_file".path;
};
};
dgn-web.simpleProxies.forgejo = {
inherit host 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";
};
2024-02-21 22:42:57 +01:00
dgn-backups.jobs.forgejo.settings.paths = builtins.map (dir: "/var/lib/git/${dir}") [
"custom"
"data"
"repositories"
".ssh"
];
dgn-backups.postgresDatabases = [ "git" ];
}