nixos-config/hosts/phantom/forgejo.nix

54 lines
1.2 KiB
Nix
Raw Normal View History

{
lib,
pkgs,
config,
...
}:
2024-04-06 20:38:35 -03:00
let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in
{
services.nginx = {
virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
};
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
service.DISABLE_REGISTRATION = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
2024-10-05 14:10:33 -03:00
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
2024-04-06 20:38:35 -03:00
server = {
2024-05-11 18:00:19 -03:00
DOMAIN = "git.lelgenio.com";
2024-04-06 20:38:35 -03:00
HTTP_PORT = 3000;
ROOT_URL = "https://${srv.DOMAIN}/";
};
mailer = {
ENABLED = true;
2024-08-01 12:25:46 -03:00
SMTP_ADDR = "lelgenio.com";
2024-05-11 18:00:19 -03:00
FROM = "noreply@git.lelgenio.com";
USER = "noreply@git.lelgenio.com";
2024-04-06 20:38:35 -03:00
};
};
mailerPasswordFile = config.age.secrets.phantom-forgejo-mailer-password.path;
};
age.secrets.phantom-forgejo-mailer-password = {
file = ../../secrets/phantom-forgejo-mailer-password.age;
mode = "400";
owner = "forgejo";
};
}