about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--third_party/default.nix6
-rw-r--r--third_party/telega/default.nix21
-rw-r--r--users/tazjin/emacs/default.nix4
3 files changed, 25 insertions, 6 deletions
diff --git a/third_party/default.nix b/third_party/default.nix
index dafc76f8bb08..5c99b55d15f4 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -41,8 +41,9 @@ in exposed.lib.fix(self: exposed // {
   # Packages to be overridden
   originals = {
     inherit (nixpkgs) gtest openldap go grpc notmuch rr;
-    inherit (stableNixpkgs) git;
+    inherit (stableNixpkgs) git tdlib;
     ffmpeg = nixpkgs.ffmpeg-full;
+    telega = stableNixpkgs.emacsPackages.telega;
   };
 
   # Use LLVM 11
@@ -66,9 +67,6 @@ in exposed.lib.fix(self: exposed // {
   emacs27-nox = assert ((exposed.lib.versions.major nixpkgs.emacs.version) == "27");
     nixpkgs.emacs-nox;
 
-  # Provide telega.el from stable
-  stableTelega = stableNixpkgs.emacsPackages.telega;
-
   # The Go authors have released a version of Go (in alpha) that has a
   # type system. This makes it available, specifically for use with
   # //nix/buildTypedGo.
diff --git a/third_party/telega/default.nix b/third_party/telega/default.nix
new file mode 100644
index 000000000000..7eda244b7fac
--- /dev/null
+++ b/third_party/telega/default.nix
@@ -0,0 +1,21 @@
+# Pin a working combination of telega.el & tdlib, as these are totally
+# out-of-sync in nixpkgs.
+{ pkgs, ... }:
+
+let
+  tdlib = pkgs.originals.tdlib.overrideAttrs(old: {
+    version = "1.6.6";
+    src = pkgs.fetchFromGitHub {
+      owner = "tdlib";
+      repo = "td";
+      rev = "c78fbe4bc5e31395e08f916816704e8051f27296"; # 1.6.6
+      sha256 = "18ny990cvnwj5sd5jp49n0jn8b8fa8iszw4vxvsqdnw00srw0ggd";
+    };
+  });
+# Emacs packages use some sort of fixed point override scheme and
+# don't expose individual overrides in the override-functor, hence the
+# mess below.
+in pkgs.originals.telega.overrideAttrs(old: {
+  buildInputs = [ tdlib ] ++
+    (builtins.filter (p: !(p ? pname) || p.pname != "tdlib") old.buildInputs);
+})
diff --git a/users/tazjin/emacs/default.nix b/users/tazjin/emacs/default.nix
index 52e925e19757..f7ebcb1e22ef 100644
--- a/users/tazjin/emacs/default.nix
+++ b/users/tazjin/emacs/default.nix
@@ -15,7 +15,7 @@ let
   emacsWithPackages = (third_party.emacsPackagesGen third_party.emacs27).emacsWithPackages;
 
   # $PATH for binaries that need to be available to Emacs
-  emacsBinPath = lib.makeBinPath [ third_party.stableTelega ];
+  emacsBinPath = lib.makeBinPath [ third_party.telega ];
 
   identity = x: x;
 
@@ -100,7 +100,7 @@ let
     tvl
 
     # patched / overridden versions of packages
-    depot.third_party.stableTelega
+    depot.third_party.telega
     depot.third_party.emacs.exwm
     depot.third_party.emacs.rcirc
     depot.third_party.emacs.vterm