stura-infra/hosts/git/default.nix
2026-03-13 16:27:55 +01:00

72 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
"${modulesPath}/virtualisation/proxmox-lxc.nix"
];
networking = {
hostName = "git";
fqdn = "git.adm.htw.stura-dresden.de";
interfaces.eth0.ipv4.addresses = [
{
address = "141.56.51.7";
prefixLength = 24;
}
];
defaultGateway = {
address = "141.56.51.254";
interface = "eth0";
};
firewall.allowedTCPPorts = [
80
443
];
};
services = {
openssh.enable = true;
forgejo = {
enable = true;
settings = {
server = {
PROTOCOL = "http+unix";
HTTP_ADDR = "/run/forgejo/forgejo.sock";
ROOT_URL = "https://${config.networking.fqdn}";
};
oauth2_client = {
ENABLE_AUTO_REGISTRATION = "true";
REGISTER_EMAIL_CONFIRM = "false";
username = "email";
};
service = {
# SHOW_REGISTRATION_BUTTON = "false";
};
};
};
nginx = {
enable = true;
virtualHosts."${config.networking.fqdn}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://unix:/run/forgejo/forgejo.sock";
};
};
};
};
system.stateVersion = "25.11";
}