diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index 74f53cc..0afda87 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -209,6 +209,14 @@ in { example = "tcp://127.0.0.1:28333"; description = "ZMQ address for zmqpubrawtx notifications"; }; + cli = mkOption { + type = types.package; + readOnly = true; + default = pkgs.writeScriptBin "bitcoin-cli" '' + exec ${cfg.package}/bin/bitcoin-cli -datadir='${cfg.dataDir}' "$@" + ''; + description = "Binary to connect with the bitcoind instance."; + }; enforceTor = nix-bitcoin-services.enforceTor; }; }; diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index 01dede1..2b70120 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -119,7 +119,6 @@ in { services.onion-chef.access.operator = [ "bitcoind" "clightning" "nginx" "liquidd" "spark-wallet" "electrs" "sshd" ]; environment.interactiveShellInit = '' - alias bitcoin-cli='bitcoin-cli -datadir=${config.services.bitcoind.dataDir}' ${optionalString (config.services.clightning.enable) '' alias lightning-cli='sudo -u clightning lightning-cli --lightning-dir=${config.services.clightning.dataDir}' ''} @@ -188,6 +187,7 @@ in { environment.systemPackages = with pkgs; [ tor blockchains.bitcoind + (hiPrio config.services.bitcoind.cli) nodeinfo banlist jq