summaryrefslogtreecommitdiff
path: root/hosts/poweredge/bitcoind.nix
blob: e28223493474188394af1950753404fdad029e55 (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
{
	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
			p2pPort = 8333;
			rpcPort = 8332;
		in {
			# Network
			networking.enableIPv6 = false;
			networking.interfaces.eth0.useDHCP = true;
			networking.firewall.allowedTCPPorts = [ p2pPort rpcPort ];

			# Bitcoin
			services.bitcoind."main" = {
				enable = true;
				port = p2pPort;
				rpc.port = rpcPort;
				rpc.users.timmy.passwordHMAC = "7557196eec6e3e062a57b0720abff7cf$617211e94b964f548cfbb5c23590f690c2940e424fffe72485276493f1cb0b29";
				extraConfig = ''
					rpcallowip=192.168.1.0/24
					rpcbind=0.0.0.0
				'';
			};

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