ctucx.git: nixfiles

ctucx' nixfiles

commit 073d6555f4e19be18702dcdf502ccfd9c84223c3
parent f850dfeaeacd1896c3b7a31cf4845c78c194b3e9
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 14 May 2022 09:28:09 +0200

pkgs: add cinny
1 file changed, 32 insertions(+), 0 deletions(-)
A
pkgs/cinny.nix
|
32
++++++++++++++++++++++++++++++++
diff --git a/pkgs/cinny.nix b/pkgs/cinny.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
+
+let
+  configOverrides = writeText "cinny-config-overrides.json" (builtins.toJSON conf);
+
+in stdenv.mkDerivation rec {
+  pname = "cinny";
+  version = "2.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/ajbura/cinny/releases/download/v${version}/cinny-v${version}.tar.gz";
+    sha256 = "1m9w013652m9bxxvp4f41wfg2w1ljbbl0z1qcnfbwqxzj9acsnd9";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/
+    cp -R . $out/
+    ${jq}/bin/jq -s '.[0] * .[1]' "config.json" "${configOverrides}" > "$out/config.json"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Yet another Matrix client for the web";
+    homepage = "https://cinny.in/";
+    maintainers = with maintainers; [ abbe ];
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}