From 82d910e9371f5fa98f5ba10f1c94ea435700a203 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 1 Oct 2021 11:51:58 +0200 Subject: [PATCH] nbxplorer: fix bitcoind, liquidd settings - Add nbxplorer to whitelists. This is recommended by the nbxplorer docs and guarantees that nbxplorer can always p2p-connect to bitcoind/liquidd. - Enable bitcoind/liquidd p2p servers via `listen`. --- modules/btcpayserver.nix | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/modules/btcpayserver.nix b/modules/btcpayserver.nix index e44208f..cc959aa 100644 --- a/modules/btcpayserver.nix +++ b/modules/btcpayserver.nix @@ -106,18 +106,31 @@ in { inherit options; config = mkIf cfg.btcpayserver.enable { - services.bitcoind.enable = true; + services.bitcoind = { + enable = true; + rpc.users.btcpayserver = { + passwordHMACFromFile = true; + rpcwhitelist = cfg.bitcoind.rpc.users.public.rpcwhitelist ++ [ + "setban" + "generatetoaddress" + "getpeerinfo" + ]; + }; + # Enable p2p connections + listen = true; + extraConfig = '' + whitelist=${nbLib.address cfg.nbxplorer.address} + ''; + }; services.clightning.enable = mkIf (cfg.btcpayserver.lightningBackend == "clightning") true; services.lnd.enable = mkIf (cfg.btcpayserver.lightningBackend == "lnd") true; - services.liquidd.enable = mkIf cfg.btcpayserver.lbtc true; - - services.bitcoind.rpc.users.btcpayserver = { - passwordHMACFromFile = true; - rpcwhitelist = cfg.bitcoind.rpc.users.public.rpcwhitelist ++ [ - "setban" - "generatetoaddress" - "getpeerinfo" - ]; + services.liquidd = mkIf cfg.btcpayserver.lbtc { + enable = true; + # Enable p2p connections + listen = true; + extraConfig = '' + whitelist=${nbLib.address cfg.nbxplorer.address} + ''; }; services.lnd.macaroons.btcpayserver = mkIf (cfg.btcpayserver.lightningBackend == "lnd") {