nixpkgs/pkgs/applications/blockchains/torq/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.3 KiB
Nix
Raw Normal View History

2023-01-15 18:19:39 +01:00
{ lib
, buildGoModule
2023-02-08 12:09:32 +01:00
, buildNpmPackage
2023-01-19 19:56:18 +01:00
, fetchFromGitHub
}:
2023-01-15 18:19:39 +01:00
2023-02-08 12:09:32 +01:00
let
2023-01-15 18:19:39 +01:00
pname = "torq";
2023-03-07 00:43:25 +01:00
version = "0.18.19";
2023-01-15 18:19:39 +01:00
src = fetchFromGitHub {
owner = "lncapital";
repo = pname;
rev = "v${version}";
2023-03-07 00:43:25 +01:00
hash = "sha256-qJIAH8SrB5a7j6ptorEm6fryZj63vDQIUQIgRsVn1us=";
2023-01-15 18:19:39 +01:00
};
2023-02-08 12:09:32 +01:00
web = buildNpmPackage {
pname = "${pname}-frontend";
inherit version;
src = "${src}/web";
2023-03-07 00:43:25 +01:00
npmDepsHash = "sha256-WulYJE2pdVa5hquV/7UjR1z9PkglJXOq5fv8nLa4wos=";
2023-02-08 12:09:32 +01:00
# copied from upstream Dockerfile
npmInstallFlags = [ "--legacy-peer-deps" ];
TSX_COMPILE_ON_ERROR="true";
ESLINT_NO_DEV_ERRORS="true";
# override npmInstallHook, we only care about the build/ directory
installPhase = ''
mkdir $out
2023-02-13 14:40:29 +01:00
cp -r build/* $out/
2023-02-08 12:09:32 +01:00
'';
};
in
buildGoModule rec {
inherit pname version src;
2023-02-13 14:58:17 +01:00
vendorHash = "sha256-bvisI589Gq9IdyJEqI+uzs3iDPOTUkq95P3n/KoFhF0=";
2023-01-15 18:19:39 +01:00
subPackages = [ "cmd/torq" ];
ldflags = [
"-s"
"-w"
2023-01-19 19:56:18 +01:00
"-X github.com/lncapital/torq/build.version=v${version}"
2023-01-15 18:19:39 +01:00
];
2023-02-08 12:09:32 +01:00
postInstall = ''
2023-02-13 14:40:29 +01:00
mkdir -p $out/web/build
cp -r ${web}/* $out/web/build/
2023-02-08 12:09:32 +01:00
'';
2023-01-15 18:19:39 +01:00
meta = with lib; {
description = "Capital management tool for lightning network nodes";
license = licenses.mit;
homepage = "https://github.com/lncapital/torq";
maintainers = with maintainers; [ mmilata prusnak ];
};
}