diff options
author | Vincent Ambo <tazjin@google.com> | 2019-12-16T13·33+0000 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2019-12-16T13·33+0000 |
commit | 99909ddd043554347dae0583d4096cbfc5880041 (patch) | |
tree | 9b21dadc1e5cc05f329b1263a54efaa0d3e20595 /tools/emacs/default.nix | |
parent | 0e5da6c34cc83a5f992bc3f3a2611b377ac5add3 (diff) |
feat(emacs): Add `withLocalConfig` override function r/167
This function makes it possible to pass in a folder with additional local configuration from somewhere downstream.
Diffstat (limited to 'tools/emacs/default.nix')
-rw-r--r-- | tools/emacs/default.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/emacs/default.nix b/tools/emacs/default.nix index 8d12bcb11dbf..8f036208e902 100644 --- a/tools/emacs/default.nix +++ b/tools/emacs/default.nix @@ -84,12 +84,20 @@ let # Custom packages [ carp-mode localPackages.dottime localPackages.term-switcher ] ))); -in lib.fix(self: f: third_party.writeShellScriptBin "tazjins-emacs" '' +in lib.fix(self: l: f: third_party.writeShellScriptBin "tazjins-emacs" '' exec ${tazjinsEmacs f}/bin/emacs \ --debug-init \ --no-site-file \ --no-site-lisp \ --no-init-file \ - --directory ${./config} \ + --directory ${./config} ${if l != null then "--directory ${l}" else ""} \ --eval "(require 'init)" $@ - '' // { overrideEmacs = f': self f'; }) identity + '' // { + # Call overrideEmacs with a function (pkgs -> pkgs) to modify the + # packages that should be included in this Emacs distribution. + overrideEmacs = f': self l f'; + + # Call withLocalConfig with the path to a *folder* containing a + # `local.el` which provides local system configuration. + withLocalConfig = confDir: self confDir f; + }) null identity |