2023-01-15 17:19:39 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
2023-02-08 11:09:32 +00:00
|
|
|
, buildNpmPackage
|
2023-01-19 18:56:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
2023-01-15 17:19:39 +00:00
|
|
|
|
2023-02-08 11:09:32 +00:00
|
|
|
let
|
2023-01-15 17:19:39 +00:00
|
|
|
pname = "torq";
|
2023-03-06 23:43:25 +00:00
|
|
|
version = "0.18.19";
|
2023-01-15 17:19:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lncapital";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-06 23:43:25 +00:00
|
|
|
hash = "sha256-qJIAH8SrB5a7j6ptorEm6fryZj63vDQIUQIgRsVn1us=";
|
2023-01-15 17:19:39 +00:00
|
|
|
};
|
|
|
|
|
2023-02-08 11:09:32 +00:00
|
|
|
web = buildNpmPackage {
|
|
|
|
pname = "${pname}-frontend";
|
|
|
|
inherit version;
|
|
|
|
src = "${src}/web";
|
2023-03-06 23:43:25 +00:00
|
|
|
npmDepsHash = "sha256-WulYJE2pdVa5hquV/7UjR1z9PkglJXOq5fv8nLa4wos=";
|
2023-02-08 11:09:32 +00: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 13:40:29 +00:00
|
|
|
cp -r build/* $out/
|
2023-02-08 11:09:32 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
inherit pname version src;
|
|
|
|
|
2023-02-13 13:58:17 +00:00
|
|
|
vendorHash = "sha256-bvisI589Gq9IdyJEqI+uzs3iDPOTUkq95P3n/KoFhF0=";
|
2023-01-15 17:19:39 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/torq" ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-01-19 18:56:18 +00:00
|
|
|
"-X github.com/lncapital/torq/build.version=v${version}"
|
2023-01-15 17:19:39 +00:00
|
|
|
];
|
|
|
|
|
2023-02-08 11:09:32 +00:00
|
|
|
postInstall = ''
|
2023-02-13 13:40:29 +00:00
|
|
|
mkdir -p $out/web/build
|
|
|
|
cp -r ${web}/* $out/web/build/
|
2023-02-08 11:09:32 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-15 17:19:39 +00: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 ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "torq";
|
2023-01-15 17:19:39 +00:00
|
|
|
};
|
|
|
|
}
|