summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2016-08-18 08:16:48 -0500
committerGitHub <noreply@github.com>2016-08-18 08:16:48 -0500
commitda681277373320321a4e60f3491915b16f0b9f80 (patch)
tree548de529bc5c3fc87fce60c3ed7f3b541f946bf2
parent2ba494b728ef9ba46e525132457a45a2384cf40e (diff)
parent6ceedaaee4d39bf595c5ae5418b38fb7d03df06f (diff)
downloadnixlib-da681277373320321a4e60f3491915b16f0b9f80.tar
nixlib-da681277373320321a4e60f3491915b16f0b9f80.tar.gz
nixlib-da681277373320321a4e60f3491915b16f0b9f80.tar.bz2
nixlib-da681277373320321a4e60f3491915b16f0b9f80.tar.lz
nixlib-da681277373320321a4e60f3491915b16f0b9f80.tar.xz
nixlib-da681277373320321a4e60f3491915b16f0b9f80.tar.zst
nixlib-da681277373320321a4e60f3491915b16f0b9f80.zip
Merge pull request #17806 from matthewbauer/emacs-wrapper
emacs: add versatile "emacsWrapper"
-rw-r--r--pkgs/build-support/emacs/wrapper.nix8
-rw-r--r--pkgs/top-level/emacs-packages.nix6
2 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix
index 45931e6914ad..cc3ea8990431 100644
--- a/pkgs/build-support/emacs/wrapper.nix
+++ b/pkgs/build-support/emacs/wrapper.nix
@@ -36,7 +36,10 @@ in customEmacsPackages.emacsWithPackages (epkgs: [ epkgs.evil epkgs.magit ])
 
 with lib; let inherit (self) emacs; in
 
-packagesFun: # packages explicitly requested by the user
+{
+  packagesFun ? [], # packages explicitly requested by the user
+  extraStart ? ""
+}:
 
 let
   explicitRequires =
@@ -53,7 +56,7 @@ stdenv.mkDerivation {
   # Store all paths we want to add to emacs here, so that we only need to add
   # one path to the load lists
   deps = runCommand "emacs-packages-deps"
-   { inherit explicitRequires lndir emacs; }
+   { inherit explicitRequires lndir emacs extraStart; }
    ''
      mkdir -p $out/bin
      mkdir -p $out/share/emacs/site-lisp
@@ -96,6 +99,7 @@ stdenv.mkDerivation {
 (load-file "$emacs/share/emacs/site-lisp/site-start.el")
 (add-to-list 'load-path "$out/share/emacs/site-lisp")
 (add-to-list 'exec-path "$out/bin")
+$extraStart
 EOF
 
      # Byte-compiling improves start-up time only slightly, but costs nothing.
diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/top-level/emacs-packages.nix
index d2e3d2b866f9..ef616f37e0c0 100644
--- a/pkgs/top-level/emacs-packages.nix
+++ b/pkgs/top-level/emacs-packages.nix
@@ -63,7 +63,7 @@ let
     inherit fetchurl lib stdenv texinfo;
   };
 
-  emacsWithPackages = import ../build-support/emacs/wrapper.nix {
+  emacsWrapper = import ../build-support/emacs/wrapper.nix {
     inherit lib lndir makeWrapper stdenv runCommand;
   };
 
@@ -71,7 +71,9 @@ let
 
   inherit emacs melpaBuild trivialBuild;
 
-  emacsWithPackages = emacsWithPackages self;
+  emacsWrapper = emacsWrapper self;
+
+  emacsWithPackages = packagesFun: emacsWrapper { inherit packagesFun; };
 
   ## START HERE