about summary refs log tree commit diff
path: root/pkgs/by-name/ki/kiwitalk/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ki/kiwitalk/package.nix')
-rw-r--r--pkgs/by-name/ki/kiwitalk/package.nix60
1 files changed, 10 insertions, 50 deletions
diff --git a/pkgs/by-name/ki/kiwitalk/package.nix b/pkgs/by-name/ki/kiwitalk/package.nix
index 2a581feb26842..23e87bdb43c3a 100644
--- a/pkgs/by-name/ki/kiwitalk/package.nix
+++ b/pkgs/by-name/ki/kiwitalk/package.nix
@@ -2,7 +2,6 @@
 , fetchFromGitHub
 , copyDesktopItems
 , stdenv
-, stdenvNoCC
 , rustc
 , rustPlatform
 , cargo
@@ -12,20 +11,18 @@
 , webkitgtk
 , pkg-config
 , makeDesktopItem
-, jq
-, moreutils
-, nodePackages
-, cacert
+, pnpm
+, nodejs
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "kiwitalk";
   version = "0.5.1";
 
   src = fetchFromGitHub {
     owner = "KiwiTalk";
     repo = "KiwiTalk";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     hash = "sha256-Th8q+Zbc102fIk2v7O3OOeSriUV/ydz60QwxzmS7AY8=";
   };
 
@@ -34,43 +31,9 @@ stdenv.mkDerivation rec {
       --replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
   '';
 
-  pnpm-deps = stdenvNoCC.mkDerivation {
-    pname = "${pname}-pnpm-deps";
-    inherit src version;
-
-    nativeBuildInputs = [
-      jq
-      moreutils
-      nodePackages.pnpm
-      cacert
-    ];
-
-    installPhase = ''
-      export HOME=$(mktemp -d)
-      pnpm config set store-dir $out
-      # This version of the package has different versions of esbuild as a dependency.
-      # You can use the command below to get esbuild binaries for a specific platform and calculate hashes for that platforms. (linux, darwin for os, and x86, arm64, ia32 for cpu)
-      # cat package.json | jq '.pnpm.supportedArchitectures += { "os": ["linux"], "cpu": ["arm64"] }' | sponge package.json
-      pnpm install --frozen-lockfile --ignore-script
-
-      # Remove timestamp and sort the json files.
-      rm -rf $out/v3/tmp
-      for f in $(find $out -name "*.json"); do
-        sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f
-        jq --sort-keys . $f | sponge $f
-      done
-    '';
-
-    dontBuild = true;
-    dontFixup = true;
-    outputHashMode = "recursive";
-    outputHash = {
-      x86_64-linux = "sha256-LJPjWNpVfdUu8F5BMhAzpTo/h6ax7lxY2EESHj5P390=";
-      aarch64-linux = "sha256-N1K4pV5rbWmO/KonvYegzBoWa6TYQIqhQyxH/sWjOJQ=";
-      i686-linux = "sha256-/Q7VZahYhLdKVFB25CanROYxD2etQOcRg+4bXZUMqTc=";
-      x86_64-darwin = "sha256-9biFAbFD7Bva7KPKztgCvcaoX8E6AlJBKkjlDQdP6Zw=";
-      aarch64-darwin = "sha256-to5Y0R9tm9b7jUQAK3eBylLhpu+w5oDd63FbBCBAvd8=";
-    }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
+  pnpmDeps = pnpm.fetchDeps {
+    inherit (finalAttrs) pname version src;
+    hash = "sha256-gf3vmKUta8KksUOxyhQS4UO6ycAJDfEicyXVGMW8+4c=";
   };
 
   cargoDeps = rustPlatform.importCargoLock {
@@ -86,7 +49,8 @@ stdenv.mkDerivation rec {
     cargo
     rustc
     cargo-tauri
-    nodePackages.pnpm
+    nodejs
+    pnpm.configHook
     copyDesktopItems
     pkg-config
   ];
@@ -98,10 +62,6 @@ stdenv.mkDerivation rec {
   ];
 
   preBuild = ''
-    export HOME=$(mktemp -d)
-    pnpm config set store-dir ${pnpm-deps}
-    pnpm install --offline --frozen-lockfile --ignore-script
-    pnpm rebuild
     cargo tauri build -b deb
   '';
 
@@ -131,4 +91,4 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux ++ platforms.darwin;
     mainProgram = "kiwi-talk";
   };
- }
+})