nix/nixos/services/forgejo.nix
2024-02-26 18:26:21 +00:00

26 lines
654 B
Nix

{config, ...}: let
cfg = config.services.forgejo;
in {
services.forgejo = {
enable = true;
dump.enable = true;
lfs.enable = true;
settings = {
server = {
ROOT_URL = "https://${cfg.settings.server.DOMAIN}";
DOMAIN = "git.${config.networking.domain}";
};
service = {
DISABLE_REGISTRATION = true;
};
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
};
};
services.nginx.virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
locations."~".proxyPass = "http://localhost:${toString cfg.settings.server.HTTP_PORT}";
};
}