about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix')
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
index 7736c8b66bd1..900e0980e74c 100644
--- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
+++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
@@ -8,7 +8,15 @@
 
 with lib;
 
-mkDerivation rec {
+let
+  # TODO: Not optimal (maybe we should only package the stable versions)
+  previewPatches = fetchFromGitHub {
+    owner = "primeos";
+    repo = "nixpkgs-tdesktop-patches";
+    rev = "b3c0cbce1b412443a8712c90069932bbcae87fb6";
+    sha256 = "1bymrciaci6plghaz7a6qwsidjm8rg5fqdh158cdp70il4g7kmw9";
+  };
+in mkDerivation rec {
   name = "telegram-desktop-${version}";
   inherit version;
 
@@ -29,7 +37,10 @@ mkDerivation rec {
   };
 
   # TODO: libtgvoip.patch no-gtk2.patch
-  patches = [ "${archPatches}/tdesktop.patch" ]
+  patches =
+    (if stable
+      then [ "${archPatches}/tdesktop.patch" ]
+      else [ "${previewPatches}/tdesktop.patch" ])
     # TODO: Only required to work around a compiler bug.
     # This should be fixed in GCC 7.3.1 (or later?)
     ++ [ ./fix-internal-compiler-error.patch ];