diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index c1abaff..55840c9 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -69,7 +69,7 @@ in { package = mkOption { type = types.package; - default = pkgs.blockchains.bitcoind; + default = pkgs.nix-bitcoin.bitcoind; defaultText = "pkgs.blockchains.bitcoind"; description = "The package providing bitcoin binaries."; }; diff --git a/modules/clightning.nix b/modules/clightning.nix index a01ff7c..4e68d8b 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -71,7 +71,7 @@ in { systemd.services.clightning = { description = "Run clightningd"; - path = [ pkgs.blockchains.bitcoind ]; + path = [ pkgs.nix-bitcoin.bitcoind ]; wantedBy = [ "multi-user.target" ]; requires = [ "bitcoind.service" ]; after = [ "bitcoind.service" ]; @@ -87,7 +87,7 @@ in { ''; serviceConfig = { PermissionsStartOnly = "true"; - ExecStart = "${pkgs.clightning}/bin/lightningd --lightning-dir=${cfg.dataDir}"; + ExecStart = "${pkgs.nix-bitcoin.clightning}/bin/lightningd --lightning-dir=${cfg.dataDir}"; User = "clightning"; Restart = "on-failure"; RestartSec = "10s"; diff --git a/modules/electrs.nix b/modules/electrs.nix index 77d8944..1ad1f09 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -74,7 +74,7 @@ in { preStart = '' mkdir -m 0770 -p ${cfg.dataDir} chown -R '${cfg.user}:${cfg.group}' ${cfg.dataDir} - echo "${pkgs.electrs}/bin/electrs -vvv ${index-batch-size} ${jsonrpc-import} --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat /secrets/bitcoin-rpcpassword) --electrum-rpc-addr=127.0.0.1:${toString cfg.port}" > /run/electrs/startscript.sh + echo "${pkgs.nix-bitcoin.electrs}/bin/electrs -vvv ${index-batch-size} ${jsonrpc-import} --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat /secrets/bitcoin-rpcpassword) --electrum-rpc-addr=127.0.0.1:${toString cfg.port}" > /run/electrs/startscript.sh ''; serviceConfig = rec { RuntimeDirectory = "electrs"; diff --git a/modules/lightning-charge.nix b/modules/lightning-charge.nix index 003a1b3..d22e7ac 100644 --- a/modules/lightning-charge.nix +++ b/modules/lightning-charge.nix @@ -31,7 +31,7 @@ in { after = [ "clightning.service" ]; serviceConfig = { EnvironmentFile = "/secrets/lightning-charge-api-token"; - ExecStart = "${pkgs.lightning-charge}/bin/charged -l ${config.services.clightning.dataDir} -d ${config.services.clightning.dataDir}/lightning-charge.db"; + ExecStart = "${pkgs.nix-bitcoin.lightning-charge}/bin/charged -l ${config.services.clightning.dataDir} -d ${config.services.clightning.dataDir}/lightning-charge.db"; # Unfortunately c-lightning doesn't allow setting the permissions of the rpc socket, # so this must run as the clightning user # https://github.com/ElementsProject/lightning/issues/1366 diff --git a/modules/liquid.nix b/modules/liquid.nix index 5ce72e2..0298413 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -180,7 +180,7 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.elementsd ]; + environment.systemPackages = [ pkgs.nix-bitcoin.elementsd ]; systemd.services.liquidd = { description = "Elements daemon providing access to the Liquid sidechain"; requires = [ "bitcoind.service" ]; @@ -200,7 +200,7 @@ in { Type = "simple"; User = "${cfg.user}"; Group = "${cfg.group}"; - ExecStart = "${pkgs.elementsd}/bin/elementsd ${cmdlineOptions}"; + ExecStart = "${pkgs.nix-bitcoin.elementsd}/bin/elementsd ${cmdlineOptions}"; StateDirectory = "liquidd"; PIDFile = "${pidFile}"; Restart = "on-failure"; diff --git a/modules/lnd.nix b/modules/lnd.nix index 3806477..f7794de 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -102,7 +102,7 @@ in { systemd.services.lnd = { description = "Run LND"; - path = [ pkgs.blockchains.bitcoind ]; + path = [ pkgs.nix-bitcoin.bitcoind ]; wantedBy = [ "multi-user.target" ]; requires = [ "bitcoind.service" ]; after = [ "bitcoind.service" ]; @@ -115,7 +115,7 @@ in { ''; serviceConfig = { PermissionsStartOnly = "true"; - ExecStart = "${pkgs.lnd}/bin/lnd --configfile=${cfg.dataDir}/lnd.conf"; + ExecStart = "${pkgs.nix-bitcoin.lnd}/bin/lnd --configfile=${cfg.dataDir}/lnd.conf"; ExecStartPost = "${pkgs.bash}/bin/bash ${init-lnd-wallet-script}"; User = "lnd"; Restart = "on-failure"; diff --git a/modules/modules.nix b/modules/modules.nix index 7dba3c6..1955528 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -27,5 +27,7 @@ in { disabledModules = [ "services/networking/bitcoind.nix" ]; - nixpkgs.overlays = [ (self: super: allPackages super) ]; + nixpkgs.overlays = [ (self: super: { + nix-bitcoin = allPackages super; + }) ]; } diff --git a/modules/nanopos.nix b/modules/nanopos.nix index 9fb5337..f21b1a0 100644 --- a/modules/nanopos.nix +++ b/modules/nanopos.nix @@ -65,7 +65,7 @@ in { after = [ "lightning-charge.service" ]; serviceConfig = { EnvironmentFile = "/secrets/lightning-charge-api-token-for-nanopos"; - ExecStart = "${pkgs.nanopos}/bin/nanopos -y ${cfg.itemsFile} -p ${toString cfg.port} --show-bolt11"; + ExecStart = "${pkgs.nix-bitcoin.nanopos}/bin/nanopos -y ${cfg.itemsFile} -p ${toString cfg.port} --show-bolt11"; User = "nanopos"; Restart = "on-failure"; diff --git a/modules/nix-bitcoin-webindex.nix b/modules/nix-bitcoin-webindex.nix index 96849bf..b69e1ff 100644 --- a/modules/nix-bitcoin-webindex.nix +++ b/modules/nix-bitcoin-webindex.nix @@ -74,7 +74,7 @@ in { description = "Get node info"; wantedBy = [ "multi-user.target" ]; after = [ "nodeinfo.service" ]; - path = [ pkgs.nodeinfo pkgs.clightning pkgs.jq pkgs.sudo ]; + path = with pkgs; [ nix-bitcoin.nodeinfo nix-bitcoin.clightning jq sudo ]; serviceConfig = { ExecStart="${pkgs.bash}/bin/bash ${createWebIndex}"; User = "root"; diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index 2ae3ac4..9013726 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -167,9 +167,9 @@ in { }]; version = 3; }; - environment.systemPackages = with pkgs; [ + environment.systemPackages = with pkgs; with nix-bitcoin; [ tor - blockchains.bitcoind + bitcoind (hiPrio config.services.bitcoind.cli) nodeinfo jq diff --git a/modules/recurring-donations.nix b/modules/recurring-donations.nix index 1f9e491..c258bff 100644 --- a/modules/recurring-donations.nix +++ b/modules/recurring-donations.nix @@ -82,7 +82,7 @@ in { description = "Run recurring-donations"; requires = [ "clightning.service" ]; after = [ "clightning.service" ]; - path = [ pkgs.clightning pkgs.curl pkgs.torsocks pkgs.sudo pkgs.jq ]; + path = with pkgs; [ nix-bitcoin.clightning curl torsocks sudo jq ]; serviceConfig = { ExecStart = "${pkgs.bash}/bin/bash ${recurring-donations-script}"; # TODO: would be better if this was operator, but I don't get sudo diff --git a/modules/spark-wallet.nix b/modules/spark-wallet.nix index e978c7c..3de3249 100644 --- a/modules/spark-wallet.nix +++ b/modules/spark-wallet.nix @@ -8,7 +8,7 @@ let dataDir = "/var/lib/spark-wallet/"; onion-chef-service = (if cfg.onion-service then [ "onion-chef.service" ] else []); run-spark-wallet = pkgs.writeScript "run-spark-wallet" '' - CMD="${pkgs.spark-wallet}/bin/spark-wallet --ln-path ${cfg.ln-path} -Q -k -c /secrets/spark-wallet-login" + CMD="${pkgs.nix-bitcoin.spark-wallet}/bin/spark-wallet --ln-path ${cfg.ln-path} -Q -k -c /secrets/spark-wallet-login" ${optionalString cfg.onion-service '' echo Getting onion hostname