{ config, pkgs, lib, ... }: { services = { bitcoind.mainnet = { enable = true; prune = 0; testnet = false; dataDir = "/var/lib/bitcoind"; extraConfig = '' bind=127.0.0.1 bind=[::1] listen=1 listenonion=1 onlynet=onion proxy=127.0.0.1:9050 proxyrandomize=1 torcontrol=127.0.0.1:9051 discover=0 txindex=1 disablewallet=0 maxconnections=60 maxuploadtarget=20480 dbcache=8192 bantime=86400 whitelist=download@127.0.0.1 rpcauth=lnd:62e0c50a38ad22a6a40099db6f50a82c$5a27c8999ee5222c4edc28c699737f23d978df8ad6e267e21242328d5d1e7426 rpccookiefile=/var/lib/bitcoind/.cookie rpccookieperms=group rpcbind=127.0.0.1 rpcbind=10.88.0.1 rpcallowip=127.0.0.1 rpcallowip=10.88.0.0/16 zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28333 ''; }; tor = { enable = true; client.enable = true; settings = { ControlPort = 9051; CookieAuthentication = true; CookieAuthFile = "/run/tor/control.authcookie"; CookieAuthFileGroupReadable = true; }; }; }; systemd.services.tor.serviceConfig.Group = "tor"; systemd.tmpfiles.rules = [ "d /var/lib/tor 0750 tor tor - -" ]; users.groups.tor = { }; users.users.bitcoind-mainnet.extraGroups = [ "tor" ]; }