Build Emacs's telega-server in NixOS

Posted on April 2, 2026
Tags:

Table of Contents

  1. Upgrade Doom Emacs
  2. Downgrade telega.el and manual rebuild
  3. Restart Emacs daemon
  4. Pin telega.el in Doom Emacs

Upgrade Doom Emacs

After doom sync -u, I upgraded telega.el to the latest and rebuilt telega-server. On startup, telega reported that tdlib version 1.8.55 is too old and a newer tdlib is required.

Downgrade telega.el and manual rebuild

A minimal setup: start a nix shell with nix-shell -p zlib pkg-config. Then change to the telega server directory ~/.config/emacs/.local/straight/repos/telega.el/server and run make. Overwrite the runtime binary at ~/.config/telega/telega-server with the newly built binary.

Notes on pkg-config detection:

  1. Inside the nix shell, pkg-config --cflags zlib is detectable, but it may not be found outside that environment.
  2. Use PKG_CONFIG_DEBUG_SPEW=1 pkg-config --cflags zlib to inspect detailed pkg-config logs.

Restart Emacs daemon

  1. Restart the user daemon: systemctl --user restart emacs.
  2. Open an Emacs client and start telega.

Pin telega.el in Doom Emacs

In your Doom Emacs packages.el, pin telega.el to the commit that works fine with tdlib 1.8.55, fe91f0d4eed1cc4a6a4df4e69fd69cf98fc1ce65