diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index 5ee9363..b2f6827 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -27,6 +27,10 @@ let ${optionalString (cfg.rpcuser != null) "rpcuser=${cfg.rpcuser}"} ${optionalString (cfg.rpcpassword != null) "rpcpassword=${cfg.rpcpassword}"} + # ZMQ options + ${optionalString (cfg.zmqpubrawblock != null) "zmqpubrawblock=${cfg.zmqpubrawblock}"} + ${optionalString (cfg.zmqpubrawtx != null) "zmqpubrawtx=${cfg.zmqpubrawtx}"} + # Extra config options (from bitcoind nixos service) ${cfg.extraConfig} ''; @@ -249,9 +253,9 @@ in { PermissionsStartOnly = "true"; } // nix-bitcoin-services.defaultHardening // (if cfg.enforceTor - then nix-bitcoin-services.allowTor - else nix-bitcoin-services.allowAnyIP - ) // optionalAttrs config.services.lnd.enable nix-bitcoin-services.allowAnyProtocol; # FOR ZMQ + then nix-bitcoin-services.allowTor + else nix-bitcoin-services.allowAnyIP) + // optionalAttrs (cfg.zmqpubrawblock != null || cfg.zmqpubrawtx != null) nix-bitcoin-services.allowAnyProtocol; }; systemd.services.bitcoind-import-banlist = { description = "Bitcoin daemon banlist importer"; diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index ba8c4d4..01dede1 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -75,8 +75,6 @@ in { discover=0 addresstype=bech32 changetype=bech32 - ${optionalString (config.services.lnd.enable) "zmqpubrawblock=${config.services.bitcoind.zmqpubrawblock}"} - ${optionalString (config.services.lnd.enable) "zmqpubrawtx=${config.services.bitcoind.zmqpubrawtx}"} ''; services.bitcoind.prune = 0; services.bitcoind.dbCache = 1000;