summaryrefslogtreecommitdiff
path: root/hosts/poweredge/immich.nix
blob: a98595eef7fa5941d49dfe9b876c88d75d01651f (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
	containers.immich = {
		autoStart = true;
		privateNetwork = true;
		extraVeths.vb-immich = {
			hostBridge = "br-lan0";
			#localMacAddress = "02:00:00:00:00:01";  # TODO update to 26.05
		};

		# Host path
		bindMounts = {
			"/var/lib/immich" = {
				hostPath = "/media/ingens/immich";
				isReadOnly = false;
			};
		};

		# GPU
		#allowedDevices = [
		#	{ node = "/dev/dri/card1"; modifier = "rw"; }
		#	{ node = "/dev/dri/renderD128"; modifier = "rw"; }
		#];

		#bindMounts = {
		#	"/dev/dri/card1" = {
		#		hostPath = "/dev/dri/card1";
		#		isReadOnly = false;
		#	};
		#	"/dev/dri/renderD128" = {
		#		hostPath = "/dev/dri/renderD128";
		#		isReadOnly = false;
		#	};
		#};

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

			# Immich
			services.immich = {
				enable = true;
				host = "0.0.0.0";
				openFirewall = true;
			};

			environment.systemPackages = with pkgs; [ immich immich-cli ];

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

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