about summary refs log tree commit diff
path: root/users/sterni/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/emacs')
-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)