From b9f51e3f7006565c0c86e72156e3ac425a0eee9d Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Sat, 3 Aug 2019 14:24:31 +0000 Subject: [PATCH] Add liquid-swap tool --- default.nix | 1 + modules/nix-bitcoin.nix | 3 ++- pkgs/liquid-swap/default.nix | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 pkgs/liquid-swap/default.nix diff --git a/default.nix b/default.nix index c2a6acf..71e47cb 100644 --- a/default.nix +++ b/default.nix @@ -13,4 +13,5 @@ elementsd = pkgs.callPackage ./pkgs/elementsd { }; hwi = pkgs.callPackage ./pkgs/hwi { }; pylightning = pkgs.python3Packages.callPackage ./pkgs/pylightning { }; + liquid-swap = pkgs.python3Packages.callPackage ./pkgs/liquid-swap { }; } diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index 15b10d5..b3def0b 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -114,6 +114,7 @@ in { alias lightning-cli='sudo -u clightning lightning-cli --lightning-dir=${config.services.clightning.dataDir}' '' + (if config.services.liquidd.enable then '' alias elements-cli='elements-cli -datadir=${config.services.liquidd.dataDir}' + alias liquidswap-cli='liquidswap-cli -c ${config.services.liquidd.dataDir}/elements.conf' '' else ""); # Unfortunately c-lightning doesn't allow setting the permissions of the rpc socket # https://github.com/ElementsProject/lightning/issues/1366 @@ -179,7 +180,7 @@ in { ++ optionals config.services.lightning-charge.enable [lightning-charge] ++ optionals config.services.nanopos.enable [nanopos] ++ optionals config.services.nix-bitcoin-webindex.enable [nginx] - ++ optionals config.services.liquidd.enable [elementsd] + ++ optionals config.services.liquidd.enable [elementsd liquid-swap] ++ optionals config.services.spark-wallet.enable [spark-wallet] ++ optionals config.services.electrs.enable [electrs] ++ optionals (config.services.hardware-wallets.ledger || config.services.hardware-wallets.trezor) [ diff --git a/pkgs/liquid-swap/default.nix b/pkgs/liquid-swap/default.nix new file mode 100644 index 0000000..ce6f227 --- /dev/null +++ b/pkgs/liquid-swap/default.nix @@ -0,0 +1,17 @@ +{ lib, buildPythonPackage, fetchurl, pyqt5, click }: + +buildPythonPackage rec { + pname = "liquid-swap"; + version = "0.0.1"; + + # We're only interested in the cli and not the gui but we need to add pyqt5 + # anyway as a build dependency because liquid-swap's setup.py demands it. See + # issue https://github.com/Blockstream/liquid-swap/issues/1. + nativeBuildInputs = [ pyqt5 ]; + propagatedBuildInputs = [ click ]; + + src = fetchurl { + urls = [ "https://github.com/Blockstream/liquid-swap/archive/release_${version}.tar.gz" ]; + sha256 = "c90ba78105469273fb799f412caa754d18bfa310984fa11ffd0091f146cca2ba"; + }; +}