summaryrefslogtreecommitdiff
path: root/hosts/poweredge/gitea.nix
blob: c7a4c70a4ceb8ad7b8a36247a3c25ad09bd1b650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
	containers.gitea = {
		autoStart = true;
		privateNetwork = true;
		extraVeths.vb-gitea = {
			hostBridge = "br-lan0";
			#localMacAddress = "02:00:00:00:00:03";  # TODO update to 26.05
		};

		config = { lib, pkgs, config, ... }: {
			# Network
			networking.interfaces.vb-gitea.useDHCP = true;
			networking.firewall.allowedTCPPorts = [ 80 22 ];  # Caddy + ssh

			# Gitea
			services.gitea = {
				enable = true;
				user = "git";  # So ssh cloning uses git@gitea
			};

			# Reverse proxy
			services.caddy = {
				enable = true;
				virtualHosts.":80".extraConfig = ''
					reverse_proxy localhost:3000
				'';
			};

			system.stateVersion = "25.11";
		};
	};
}