diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2016-08-17 18:19:58 +0000 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2016-08-17 18:19:58 +0000 |
commit | 6ceedaaee4d39bf595c5ae5418b38fb7d03df06f (patch) | |
tree | 11f50d3d36176791aa2766ee6508c2451deae1c0 /pkgs/build-support/emacs/wrapper.nix | |
parent | 963d8cc3e0c56c3149c877e399ddcfc4f95e14f9 (diff) | |
download | nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar.gz nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar.bz2 nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar.lz nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar.xz nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.tar.zst nixpkgs-6ceedaaee4d39bf595c5ae5418b38fb7d03df06f.zip |
emacs: add versatile "emacsWrapper"
"emacsWrapper" replaces emacsWithPackages. In addition to "packagesFun", emacsWrapper has an optional variable called "execStart". execStart can be used to append elisp to the default site-start.el script. This is useful for providing a way to load a user's .emacs.d/init.el file. "emacsWithPackages" is implemented with emacsWrapper for convenience and compatability.
Diffstat (limited to 'pkgs/build-support/emacs/wrapper.nix')
-rw-r--r-- | pkgs/build-support/emacs/wrapper.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index 45931e6914a..cc3ea899043 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. |