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 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-02-13 13:58:17 +00:00
version = "0.18.17";
2023-01-15 17:19:39 +00:00
src = fetchFromGitHub {
owner = "lncapital";
repo = pname;
rev = "v${version}";
2023-02-13 13:58:17 +00:00
hash = "sha256-xiA66yGo8b1+zZ7jQ7SFOtNPmqbdna7fUCT21uibrIM=";
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-02-13 13:58:17 +00:00
npmDepsHash = "sha256-/7x5RWYIB5BChYMnMuFVVaZd0pVkew4i4QrF7hSFnCM=";
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 ];
};
}