From 55e73f32e3fb3809e56f8f770334c654d56739e5 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Tue, 12 Nov 2019 19:40:30 +0100 Subject: [PATCH] bitcoind: add cli option --- modules/bitcoind.nix | 8 ++++++++ modules/nix-bitcoin.nix | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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