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`.
This commit is contained in:
Erik Arvstedt 2021-10-01 11:51:58 +02:00
parent f61e928139
commit 82d910e937
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -106,18 +106,31 @@ in {
inherit options; inherit options;
config = mkIf cfg.btcpayserver.enable { 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.clightning.enable = mkIf (cfg.btcpayserver.lightningBackend == "clightning") true;
services.lnd.enable = mkIf (cfg.btcpayserver.lightningBackend == "lnd") true; services.lnd.enable = mkIf (cfg.btcpayserver.lightningBackend == "lnd") true;
services.liquidd.enable = mkIf cfg.btcpayserver.lbtc true; services.liquidd = mkIf cfg.btcpayserver.lbtc {
enable = true;
services.bitcoind.rpc.users.btcpayserver = { # Enable p2p connections
passwordHMACFromFile = true; listen = true;
rpcwhitelist = cfg.bitcoind.rpc.users.public.rpcwhitelist ++ [ extraConfig = ''
"setban" whitelist=${nbLib.address cfg.nbxplorer.address}
"generatetoaddress" '';
"getpeerinfo"
];
}; };
services.lnd.macaroons.btcpayserver = mkIf (cfg.btcpayserver.lightningBackend == "lnd") { services.lnd.macaroons.btcpayserver = mkIf (cfg.btcpayserver.lightningBackend == "lnd") {