about summary refs log tree commit diff
path: root/pkgs/applications/blockchains/torq
diff options
context:
space:
mode:
authorMartin Milata <martin@martinmilata.cz>2023-02-08 12:09:32 +0100
committerMartin Milata <martin@martinmilata.cz>2023-02-08 16:20:29 +0100
commit7da5418f1d20665113c1530f3bb72a65ca008ac7 (patch)
treef85782184eb87c68caf0827652b6fac827542d2f /pkgs/applications/blockchains/torq
parent7a033d6395a500f53c03b808855d33a9aafc894b (diff)
downloadnixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar.gz
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar.bz2
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar.lz
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar.xz
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.tar.zst
nixlib-7da5418f1d20665113c1530f3bb72a65ca008ac7.zip
torq: build frontend
Diffstat (limited to 'pkgs/applications/blockchains/torq')
-rw-r--r--pkgs/applications/blockchains/torq/default.nix28
1 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/applications/blockchains/torq/default.nix b/pkgs/applications/blockchains/torq/default.nix
index cf7722238ef7..4b786168bce3 100644
--- a/pkgs/applications/blockchains/torq/default.nix
+++ b/pkgs/applications/blockchains/torq/default.nix
@@ -1,9 +1,10 @@
 { lib
 , buildGoModule
+, buildNpmPackage
 , fetchFromGitHub
 }:
 
-buildGoModule rec {
+let
   pname = "torq";
   version = "0.17.3";
 
@@ -14,6 +15,27 @@ buildGoModule rec {
     hash = "sha256-fqHJZi1NQCrZqsa+N+FVYZ8s9o0D555Sqn5qNlJ1MmI=";
   };
 
+  web = buildNpmPackage {
+    pname = "${pname}-frontend";
+    inherit version;
+    src = "${src}/web";
+    npmDepsHash = "sha256-8mUfTFzPjQlQvhC3zZf+WruDBkYnmGt3yckNi0CPWs0=";
+
+    # 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
+      cp -r build $out/
+    '';
+  };
+in
+buildGoModule rec {
+  inherit pname version src;
+
   vendorHash = "sha256-HETN2IMnpxnTyg6bQDpoD0saJu+gKocdEf0VzEi12Gs=";
 
   subPackages = [ "cmd/torq" ];
@@ -24,6 +46,10 @@ buildGoModule rec {
     "-X github.com/lncapital/torq/build.version=v${version}"
   ];
 
+  postInstall = ''
+    ln -s ${web} $out/web
+  '';
+
   meta = with lib; {
     description = "Capital management tool for lightning network nodes";
     license = licenses.mit;