about summary refs log tree commit diff
path: root/users/sterni
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-03-24T10·27+0100
committerclbot <clbot@tvl.fyi>2022-03-27T10·14+0000
commit8e85079012dd9869753d0f60849f83b8f3cb6459 (patch)
tree66dd213d89779ad11afda1bfc93843b4faf77546 /users/sterni
parent98371362f25202f8afae3949b618b0db78d5ea1d (diff)
feat(sterni/emacs): enable server and include emacsclient r/3920
Change-Id: Icaf22595c774bdceb7e79f5302cde8d039aa3b09
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5401
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users/sterni')
-rw-r--r--users/sterni/emacs/default.nix10
-rw-r--r--users/sterni/emacs/init.el3
2 files changed, 11 insertions, 2 deletions
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 "<leader>ls") 'languagetool-set-language)
   (evil-define-key 'normal 'global (kbd "<leader>lr") 'languagetool-clear-buffer))
 
+(unless (server-running-p)
+  (server-start))
+
 (require 'subscriptions)
 (require 'nix-inject)