cl-rest: rename pkg to clightning-rest
This commit is contained in:
17
pkgs/clightning-rest/composition.nix
Normal file
17
pkgs/clightning-rest/composition.nix
Normal 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-12_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import "${toString pkgs.path}/pkgs/development/node-packages/node-env.nix" {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
|
||||
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;
|
||||
}
|
||||
23
pkgs/clightning-rest/default.nix
Normal file
23
pkgs/clightning-rest/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ pkgs, lib, makeWrapper }:
|
||||
let
|
||||
inherit (pkgs) nodejs;
|
||||
nodePackages = import ./composition.nix { inherit pkgs nodejs; };
|
||||
in
|
||||
nodePackages.package.overrideAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
makeWrapper ${nodejs}/bin/node $out/bin/cl-rest \
|
||||
--add-flags $out/lib/node_modules/c-lightning-rest/cl-rest
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "REST API for C-Lightning";
|
||||
homepage = "https://github.com/Ride-The-Lightning/c-lightning-REST";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ nixbitcoin earvstedt ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
})
|
||||
44
pkgs/clightning-rest/generate.sh
Executable file
44
pkgs/clightning-rest/generate.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix gnupg wget jq gnused
|
||||
set -euo pipefail
|
||||
|
||||
TMPDIR="$(mktemp -d -p /tmp)"
|
||||
trap "rm -rf $TMPDIR" EXIT
|
||||
|
||||
version="0.7.0"
|
||||
repo=https://github.com/Ride-The-Lightning/c-lightning-REST
|
||||
|
||||
# Fetch and verify source tarball
|
||||
file=v${version}.tar.gz
|
||||
url=$repo/archive/refs/tags/$file
|
||||
export GNUPGHOME=$TMPDIR
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
|
||||
wget -P $TMPDIR $url
|
||||
wget -P $TMPDIR $repo/releases/download/v${version}/$file.asc
|
||||
gpg --verify $TMPDIR/$file.asc $TMPDIR/$file
|
||||
hash=$(nix hash file $TMPDIR/$file)
|
||||
|
||||
# Extract source
|
||||
src=$TMPDIR/src
|
||||
mkdir $src
|
||||
tar xvf $TMPDIR/$file -C $src --strip-components 1 >/dev/null
|
||||
|
||||
# Generate nix pkg
|
||||
node2nix \
|
||||
--input $src/package.json \
|
||||
--lock $src/package-lock.json \
|
||||
--composition composition.nix \
|
||||
--no-copy-node-env
|
||||
|
||||
# Use node-env.nix from nixpkgs
|
||||
nodeEnvImport='import "${toString pkgs.path}/pkgs/development/node-packages/node-env.nix"'
|
||||
sed -i "s|import ./node-env.nix|$nodeEnvImport|" composition.nix
|
||||
|
||||
# Use the verified package src
|
||||
read -d '' fetchurl <<EOF || :
|
||||
fetchurl {
|
||||
url = "$url";
|
||||
hash = "$hash";
|
||||
};
|
||||
EOF
|
||||
sed -i "s|src = .*/src;|src = ${fetchurl//$'\n'/\\n}|" node-packages.nix
|
||||
1476
pkgs/clightning-rest/node-packages.nix
Normal file
1476
pkgs/clightning-rest/node-packages.nix
Normal file
File diff suppressed because it is too large
Load Diff
3
pkgs/clightning-rest/pkg.json
Normal file
3
pkgs/clightning-rest/pkg.json
Normal file
@@ -0,0 +1,3 @@
|
||||
[
|
||||
{ "c-lightning-REST": "file:./package" }
|
||||
]
|
||||
Reference in New Issue
Block a user