lightning-loop: add pkg

This commit is contained in:
nixbitcoin 2020-07-07 10:30:08 +00:00
parent 272b8568e7
commit 1bb801ad7b
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
5 changed files with 55 additions and 1 deletions

View File

@ -11,6 +11,7 @@
generate-secrets = pkgs.callPackage ./generate-secrets { };
nixops19_09 = pkgs.callPackage ./nixops { };
netns-exec = pkgs.callPackage ./netns-exec { };
lightning-loop = pkgs.callPackage ./lightning-loop { };
pinned = import ./pinned.nix;
}

View File

@ -0,0 +1,23 @@
{ pkgs, buildGoModule, fetchurl, lib }:
buildGoModule rec {
pname = "lightning-loop";
version = "0.7.0-beta";
src = fetchurl {
url = "https://github.com/lightninglabs/loop/archive/v${version}.tar.gz";
# Use ./get-sha256.sh to fetch latest (verified) sha256
sha256 = "fbb5ae6dd55002a632a924e41a0bb2ce886eb9e834668be35b312b14e8b68233";
};
subPackages = [ "cmd/loop" "cmd/loopd" ];
vendorSha256 = "1g0l09zcic5nnrsdyap40dj3zl59gbb2k8iirhph3257ysa52mhr";
meta = with lib; {
description = " Lightning Loop: A Non-Custodial Off/On Chain Bridge";
homepage = "https://github.com/lightninglabs/loop";
license = lib.licenses.mit;
maintainers = with maintainers; [ nixbitcoin ];
};
}

View File

@ -0,0 +1,27 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p git gnupg
set -euo pipefail
TMPDIR="$(mktemp -d -p /tmp)"
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR
echo "Fetching latest release"
git clone https://github.com/lightninglabs/loop 2> /dev/null
cd loop
latest=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest release is ${latest}"
# GPG verification
export GNUPGHOME=$TMPDIR
echo "Fetching Joost Jager's Key"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys D146D0F68939436268FA9A130E26BB61B76C4D3A 2> /dev/null
echo "Fetching Alex Bosworth's Key"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E 2> /dev/null
echo "Verifying latest release"
git verify-tag ${latest}
echo "tag: ${latest}"
# The prefix option is necessary because GitHub prefixes the archive contents in this format
echo "sha256: $(git archive --format tar.gz --prefix=loop-${latest//v}/ ${latest} | sha256sum | cut -d\ -f1)"

View File

@ -14,6 +14,7 @@
static char *available_netns[] = {
"nb-lnd",
"nb-lightning-loop",
"nb-bitcoind",
"nb-liquidd"
};

View File

@ -11,7 +11,9 @@ in
bitcoind
clightning
lnd;
inherit (nixBitcoinPkgsUnstable) electrs;
inherit (nixBitcoinPkgsUnstable)
electrs
lightning-loop;
stable = nixBitcoinPkgsStable;
unstable = nixBitcoinPkgsUnstable;