From 8e85079012dd9869753d0f60849f83b8f3cb6459 Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 24 Mar 2022 11:27:21 +0100 Subject: feat(sterni/emacs): enable server and include emacsclient Change-Id: Icaf22595c774bdceb7e79f5302cde8d039aa3b09 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5401 Tested-by: BuildkiteCI Reviewed-by: sterni Autosubmit: sterni --- users/sterni/emacs/default.nix | 10 ++++++++-- users/sterni/emacs/init.el | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/sterni/emacs/default.nix b/users/sterni/emacs/default.nix index 798e27923fc8..90b408d2d2fe 100644 --- a/users/sterni/emacs/default.nix +++ b/users/sterni/emacs/default.nix @@ -65,10 +65,16 @@ let in # sadly we can't give an init-file via the command line -pkgs.writeShellScriptBin "emacs" '' +(pkgs.writeShellScriptBin "emacs" '' exec ${emacs}/bin/emacs \ --no-init-file \ --directory ${configDirectory} \ --eval "(require 'init)" \ "$@" -'' +'').overrideAttrs (super: { + buildCommand = '' + ${super.buildCommand} + + ln -s "${emacs}/bin/emacsclient" "$out/bin/emacsclient" + ''; +}) diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el index 9aa3efcf8018..c8c69af4eb01 100644 --- a/users/sterni/emacs/init.el +++ b/users/sterni/emacs/init.el @@ -248,6 +248,9 @@ (evil-define-key 'normal 'global (kbd "ls") 'languagetool-set-language) (evil-define-key 'normal 'global (kbd "lr") 'languagetool-clear-buffer)) +(unless (server-running-p) + (server-start)) + (require 'subscriptions) (require 'nix-inject) -- cgit 1.4.1