about summary refs log tree commit diff
path: root/pkgs/servers/mail/listmonk/frontend.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/mail/listmonk/frontend.nix')
-rw-r--r--pkgs/servers/mail/listmonk/frontend.nix41
1 files changed, 17 insertions, 24 deletions
diff --git a/pkgs/servers/mail/listmonk/frontend.nix b/pkgs/servers/mail/listmonk/frontend.nix
index 647f5cfd9f6a7..928092038c127 100644
--- a/pkgs/servers/mail/listmonk/frontend.nix
+++ b/pkgs/servers/mail/listmonk/frontend.nix
@@ -1,40 +1,33 @@
-{ yarn2nix-moretea
-, fetchFromGitHub
+{ mkYarnPackage
 , fetchYarnDeps
 , meta
+, version
+, src
 }:
 
-yarn2nix-moretea.mkYarnPackage rec {
+mkYarnPackage {
   pname = "listmonk-frontend";
-  version = "2.5.1";
-
-  src = fetchFromGitHub {
-    owner = "knadh";
-    repo = "listmonk";
-    rev = "v${version}";
-    sha256 = "sha256-gCnIblc83CmG1auvYYxqW/xBl6Oy1KHGkqSY/3yIm3I=";
-  };
+  inherit version;
 
+  src = "${src}/frontend";
   packageJSON = ./package.json;
-  yarnLock = "${src}/frontend/yarn.lock";
 
   offlineCache = fetchYarnDeps {
-    inherit yarnLock;
-    hash = "sha256-KKNk4lrM7unMFClkY6F3nqhKx5xfx87Ac+rug9sOwvI=";
+    yarnLock = "${src}/frontend/yarn.lock";
+    hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo=";
   };
 
-  # For Node.js v17+, this is necessary.
-  NODE_OPTIONS = "--openssl-legacy-provider";
-
-  installPhase = ''
-    runHook preInstall
-
-    cd deps/listmonk-frontend/frontend
-    npm run build
+  configurePhase = ''
+    ln -s $node_modules node_modules
+  '';
 
-    mv dist $out
+  buildPhase = ''
+    yarn --offline build
+  '';
 
-    runHook postInstall
+  installPhase = ''
+    mkdir $out
+    cp -R dist/* $out
   '';
 
   doDist = false;