about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/cinny
diff options
context:
space:
mode:
authorhuantian <davidtianli@gmail.com>2023-09-01 12:46:12 -0700
committerhuantian <davidtianli@gmail.com>2023-09-04 11:39:32 -0700
commite095938c264cbf9d4df737a2535d6e642293097e (patch)
treef3532442194a236de26c7cd6c48c60ef77c6cd6c /pkgs/applications/networking/instant-messengers/cinny
parent6d9e1eb60a37a4dec85623598ec38ac201e846d7 (diff)
cinny, cinny-desktop: build from source
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/cinny')
-rw-r--r--pkgs/applications/networking/instant-messengers/cinny/default.nix26
1 files changed, 17 insertions, 9 deletions
diff --git a/pkgs/applications/networking/instant-messengers/cinny/default.nix b/pkgs/applications/networking/instant-messengers/cinny/default.nix
index d8f7e72b9d1d7..336d045b6c168 100644
--- a/pkgs/applications/networking/instant-messengers/cinny/default.nix
+++ b/pkgs/applications/networking/instant-messengers/cinny/default.nix
@@ -1,22 +1,30 @@
-{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
+{ lib, buildNpmPackage, fetchFromGitHub, writeText, jq, conf ? { } }:
 
 let
   configOverrides = writeText "cinny-config-overrides.json" (builtins.toJSON conf);
-in stdenv.mkDerivation rec {
+in
+buildNpmPackage rec {
   pname = "cinny";
   version = "2.2.6";
 
-  src = fetchurl {
-    url = "https://github.com/ajbura/cinny/releases/download/v${version}/cinny-v${version}.tar.gz";
-    hash = "sha256-AvYM8++PqKmm7CJN5hmg9GSC72IoHX+rRxuT3GflvjU=";
+  src = fetchFromGitHub {
+    owner = "cinnyapp";
+    repo = "cinny";
+    rev = "v${version}";
+    hash = "sha256-Da/gbq9piKvkIMiamoafcRrqxF7128GXoswk2C43An8=";
   };
 
+  npmDepsHash = "sha256-3wgB/dQmLtwxbRsk+OUcyfx98vpCvhvseEOCrJIFohY=";
+
+  nativeBuildInputs = [
+    jq
+  ];
+
   installPhase = ''
     runHook preInstall
 
-    mkdir -p $out/
-    cp -R . $out/
-    ${jq}/bin/jq -s '.[0] * .[1]' "config.json" "${configOverrides}" > "$out/config.json"
+    cp -r dist $out
+    jq -s '.[0] * .[1]' "config.json" "${configOverrides}" > "$out/config.json"
 
     runHook postInstall
   '';
@@ -25,7 +33,7 @@ in stdenv.mkDerivation rec {
     description = "Yet another Matrix client for the web";
     homepage = "https://cinny.in/";
     maintainers = with maintainers; [ abbe ];
-    license = licenses.mit;
+    license = licenses.agpl3Only;
     platforms = platforms.all;
   };
 }