summaryrefslogtreecommitdiff
path: root/hosts/poweredge/bitcoind.nix
blob: cff9cd35f36e7a27dab16e8d1c13bb52ca3ce3f9 (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
{
	containers.bitcoind = {
		autoStart = true;
		ephemeral = true;
		privateNetwork = true;
		hostBridge = "br-lan0";
		localMacAddress = "02:00:00:00:00:04";

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

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

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

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