summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix12
-rw-r--r--pkgs/applications/editors/emacs-24/site-start.el17
2 files changed, 19 insertions, 10 deletions
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index 71b98eec0e9..af5c11e69ae 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -44,16 +44,8 @@ stdenv.mkDerivation rec {
     "-I${cairo}/include/cairo";
 
   postInstall = ''
-    cat >$out/share/emacs/site-lisp/site-start.el <<EOF
-    ;; nixos specific load-path
-    (when (getenv "NIX_PROFILES") (setq load-path
-                          (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
-                                                   (split-string (getenv "NIX_PROFILES"))))
-                           load-path)))
-        
-    ;; make tramp work for NixOS machines
-    (eval-after-load 'tramp '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))
-    EOF
+    mkdir -p $out/share/emacs/site-lisp/
+    cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
   '';
 
   doCheck = true;
diff --git a/pkgs/applications/editors/emacs-24/site-start.el b/pkgs/applications/editors/emacs-24/site-start.el
new file mode 100644
index 00000000000..023d6412ed8
--- /dev/null
+++ b/pkgs/applications/editors/emacs-24/site-start.el
@@ -0,0 +1,17 @@
+;; NixOS specific load-path
+(setq load-path
+      (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
+                               (split-string (or (getenv "NIX_PROFILES") ""))))
+              load-path))
+
+;;; Make `woman' find the man pages
+(eval-after-load 'woman
+  '(setq woman-manpath
+         (append (reverse (mapcar (lambda (x) (concat x "/share/man/"))
+                                  (split-string (or (getenv "NIX_PROFILES") ""))))
+                 woman-manpath)))
+
+;; Make tramp work for remote NixOS machines
+;;; NOTE: You might want to add 
+(eval-after-load 'tramp
+  '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))