cl-rest: init at 0.5.2

This commit is contained in:
nixbitcoin 2021-11-08 11:42:24 +00:00
parent 83196f5545
commit 0e1e2a1b3c
No known key found for this signature in database
GPG Key ID: B6044ECBA2DAE5D0
6 changed files with 1442 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}:
let
nodeEnv = import "${toString pkgs.path}/pkgs/development/node-packages/node-env.nix" {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}

5
pkgs/cl-rest/default.nix Normal file
View File

@ -0,0 +1,5 @@
{ stdenv, pkgs, lib }:
lib.head (builtins.attrValues (import ./composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
}))

31
pkgs/cl-rest/generate.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix gnupg wget jq moreutils
set -euo pipefail
TMPDIR="$(mktemp -d -p /tmp)"
trap "rm -rf $TMPDIR" EXIT
# Get/verify source tarball
version="0.5.2"
export GNUPGHOME=$TMPDIR
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
wget -P $TMPDIR https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v${version}.tar.gz
wget -P $TMPDIR https://github.com/Ride-The-Lightning/c-lightning-REST/releases/download/v${version}/v${version}.tar.gz.asc
gpg --verify $TMPDIR/v${version}.tar.gz.asc $TMPDIR/v${version}.tar.gz
shasum=$(sha256sum $TMPDIR/v${version}.tar.gz | cut -d\ -f1)
# Run node2nix
mkdir $TMPDIR/package && tar xvf $TMPDIR/v${version}.tar.gz -C $TMPDIR/package --strip-components 1
cp pkg.json $TMPDIR/pkg.json
node2nix --nodejs-10 -i $TMPDIR/pkg.json -c composition.nix --no-copy-node-env
# Set node env import.
# The reason for not providing a custom node-env.nix file is the following:
# To be flakes-compatible, we have to locate the nixpgs source via `pkgs.path` instead of `<nixpkgs>`.
# This requires the `pkgs` variable which is available only in composition.nix, not in node-env.nix.
nodeEnvImport='import "${toString pkgs.path}/pkgs/development/node-packages/node-env.nix"'
sed -i "s|import ./node-env.nix|$nodeEnvImport|" composition.nix
# Use verified source in node-packages.nix
url="https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v$version.tar.gz"
sed -i '/packageName = "c-lightning-rest";/!b;n;n;c\ src = fetchurl {\n url = "'$url'";\n sha256 = "'$shasum'";\n };' node-packages.nix

File diff suppressed because it is too large Load Diff

3
pkgs/cl-rest/pkg.json Normal file
View File

@ -0,0 +1,3 @@
[
{ "c-lightning-REST": "file:./package" }
]

View File

@ -7,6 +7,7 @@ in
}: }:
let self = { let self = {
rtl = pkgs.callPackage ./rtl { }; rtl = pkgs.callPackage ./rtl { };
cl-rest = pkgs.callPackage ./cl-rest { };
spark-wallet = pkgs.callPackage ./spark-wallet { }; spark-wallet = pkgs.callPackage ./spark-wallet { };
liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };
joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3Packages; }; joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3Packages; };