summaryrefslogtreecommitdiff
path: root/hosts/poweredge/bitcoind.nix
blob: 715fb8aba1152714298764129756843bdcbed2fe (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
{
	containers.bitcoind = {
		autoStart = true;
		ephemeral = true;
		privateNetwork = true;
		extraVeths.vb-bitcoind = {
			hostBridge = "br-lan0";
			#localMacAddress = "02:00:00:00:00:04";  # TODO update to 26.05
		};

		# Host path
		bindMounts = {
			"/var/lib/bitcoind-main" = {
				hostPath =  "/media/ingens/bitcoin";
				isReadOnly = false;
			};
		};

		config = { lib, pkgs, config, ... }: let
			btdPort = 8333;
		in {
			# Network
			networking.interfaces.vb-bitcoind.useDHCP = true;
			networking.firewall.allowedTCPPorts = [ btcPort ];

			# Bitcoin
			services.bitcoind."main" = {
				enable = true;
				port = btcPort;
			};

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