rtl: init at 0.11.2

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

View File

@ -6,6 +6,7 @@ in
, pkgsUnstable ? import nixpkgsPinned.nixpkgs-unstable { config = {}; overlays = []; } , pkgsUnstable ? import nixpkgsPinned.nixpkgs-unstable { config = {}; overlays = []; }
}: }:
let self = { let self = {
rtl = pkgs.callPackage ./rtl { };
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; };

17
pkgs/rtl/composition.nix Normal file
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/rtl/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/rtl/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.11.2"
export GNUPGHOME=$TMPDIR
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
wget -P $TMPDIR https://github.com/Ride-The-Lightning/RTL/archive/refs/tags/v${version}.tar.gz
wget -P $TMPDIR https://github.com/Ride-The-Lightning/RTL/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/RTL/archive/refs/tags/v$version.tar.gz"
sed -i '/packageName = "rtl";/!b;n;n;c\ src = fetchurl {\n url = "'$url'";\n sha256 = "'$shasum'";\n };' node-packages.nix

3066
pkgs/rtl/node-packages.nix Normal file

File diff suppressed because it is too large Load Diff

3
pkgs/rtl/pkg.json Normal file
View File

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