NixOS-Config/system/services/forgejo/default.nix

39 lines
940 B
Nix

{ outputs, ... }: {
imports = [
./nginx
];
services = {
forgejo = {
enable = true;
settings = {
server = {
DOMAIN = "git.${outputs.secrets.jimDomain}";
ROOT_URL = "https://git.${outputs.secrets.jimDomain}:443";
HTTP_PORT = 3110;
SSH_PORT = 2299;
START_SSH_SERVER = true;
};
ui = {
DEFAULT_THEME = "forgejo-dark";
};
mailer = {
ENABLED = true;
SMTP_ADDR = "mx.${outputs.secrets.jimDomain}";
FROM = "Jimbo's Git <noreply@${outputs.secrets.jimDomain}>";
USER = "noreply@${outputs.secrets.jimDomain}";
PASSWD = outputs.secrets.noreplyPassword;
PROTOCOL = "smtps";
};
service = {
REGISTER_EMAIL_CONFIRM = true;
DISABLE_REGISTRATION = true;
};
};
};
};
# Allow Forgejo's SSH to work
networking.firewall.allowedTCPPorts = [ 2299 ];
}