43 lines
1.0 KiB
Nix
43 lines
1.0 KiB
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
domain = "git.giugl.io";
|
|
|
|
utilities = import ./utilities.nix { inherit lib config; };
|
|
inherit (utilities) architectInterfaceAddress;
|
|
in
|
|
{
|
|
architect.firewall.openTCP = [ config.services.gitea.settings.server.SSH_PORT ];
|
|
|
|
services.gitea = {
|
|
enable = true;
|
|
database.type = "sqlite3";
|
|
domain = domain;
|
|
appName = "Gitea";
|
|
rootUrl = "https://${domain}";
|
|
settings = {
|
|
server = {
|
|
LFS_START_SERVER = true;
|
|
SSH_PORT = 22;
|
|
};
|
|
openid.enable_openid_signin = true;
|
|
};
|
|
};
|
|
|
|
services.nginx.virtualHosts.${domain} = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:3000";
|
|
# it does not work, it breaks gitea's web portal
|
|
# extraConfig = auth_block { access_role = "git"; };
|
|
};
|
|
};
|
|
|
|
networking.extraHosts = ''
|
|
${architectInterfaceAddress "lan"} ${domain}
|
|
${architectInterfaceAddress "wireguard"} ${domain}
|
|
${architectInterfaceAddress "tailscale"} ${domain}
|
|
'';
|
|
}
|