feat(emacs): Add telega.el support

Packages the telega-server binary and adds the required mode into
Emacs.

Unread message count is displayed in the modeline, which is neat.

Probably need to figure out some key bindings for this.
This commit is contained in:
Vincent Ambo 2019-12-19 14:48:22 +00:00
parent 166aff23bc
commit c1a5d7d62a
4 changed files with 30 additions and 0 deletions

View file

@ -171,6 +171,7 @@
(use-package nix-util)
(use-package nginx-mode)
(use-package rust-mode)
(use-package telega :config (telega-mode-line-mode 1))
(use-package terraform-mode)
(use-package toml-mode)
(use-package web-mode)

View file

@ -11,6 +11,9 @@ let
localPackages = pkgs.tools.emacs-pkgs;
emacsWithPackages = (third_party.emacsPackagesNgGen third_party.emacs26).emacsWithPackages;
# $PATH for binaries that need to be available to Emacs
emacsBinPath = lib.makeBinPath [ third_party.telega ];
identity = x: x;
tazjinsEmacs = pkgfun: (emacsWithPackages(epkgs: pkgfun(
# Actual ELPA packages (the enlightened!)
@ -68,6 +71,7 @@ let
sly
string-edit
swiper
telega
telephone-line
terraform-mode
toml-mode
@ -90,6 +94,7 @@ let
term-switcher
]))));
in lib.fix(self: l: f: third_party.writeShellScriptBin "tazjins-emacs" ''
export PATH="${emacsBinPath}:$PATH"
exec ${tazjinsEmacs f}/bin/emacs \
--debug-init \
--no-site-file \
@ -109,6 +114,7 @@ in lib.fix(self: l: f: third_party.writeShellScriptBin "tazjins-emacs" ''
# Build a derivation that uses the specified local Emacs (i.e.
# built outside of Nix) instead
withLocalEmacs = emacsBin: third_party.writeShellScriptBin "tazjins-emacs" ''
export PATH="${emacsBinPath}:$PATH"
export EMACSLOADPATH="${(tazjinsEmacs f).deps}/share/emacs/site-lisp:"
exec ${emacsBin} \
--debug-init \