Install telega in nixos

Post at — Aug 21, 2024
#telega #linux #nixos

How to install telega and use it in NixOS

What is telega?.

According to the Github repository:

Telega
telega.el is full featured unofficial client for Telegram platform for GNU Emacs.

As you may know, my main OS, at this time (2024-08-21) is NixOS, so I was trying to install Telega in my emacs, but as you can imagine, the file system hierarchy don’t works “normal” in NixOS, so is a little tricky set up the environment to actually make Telega works.

Requisites:

  • gnumake. (To compile).
  • cmake (To compile).
  • tdlib (Version > 1.8.29).

Process of installation.

  1. install the dependencies using your configuration.nix, home-manager, or wathever method you use to install packages in NixOS.
  2. Install Telega in emacs.
    1
    2
    
    (use-package telega
    :ensure t)
    
  3. Now, because I use NixOS (by the way), you must know that the file system hierarchy don’t works same as in linux or macOS, so I need to declare where telega is going to see the tdlib libraries, so:
    1
    
    (setq telega-server-lib-prefix "/home/user/.nix-profile/")
    
  4. Compile Telega-server inside emacs.
    1
    
    M-x telega-server-build
    
    Or simply run telega:
    1
    
    M-x telega
    

With that, Telega must be compiled, and ready to go.