From 9773bc32ee98ff3eea19fd55903c1d84c4ba17c1 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 7 Sep 2020 10:52:54 +0100 Subject: [PATCH] Expose withEmacsPath on emacs attribute I need this for Nix code that exists outside of this repository. --- emacs/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/emacs/default.nix b/emacs/default.nix index 685a37ec2..6c71ae0a6 100644 --- a/emacs/default.nix +++ b/emacs/default.nix @@ -4,7 +4,7 @@ let inherit (builtins) path; inherit (depot.third_party) emacsPackagesGen emacs27; inherit (pkgs) writeShellScript writeShellScriptBin; - inherit (pkgs.lib.strings) makeBinPath; + inherit (pkgs.lib.strings) concatStringsSep makeBinPath; emacsBinPath = makeBinPath (with pkgs; [ tdesktop @@ -132,12 +132,19 @@ let name = "init.el"; }; - withEmacsPath = { emacsBin, briefcasePath }: + loadPath = concatStringsSep ":" [ + wpcDir + vendorDir + # TODO: Explain why the trailing ":" is needed. + "${wpcarrosEmacs.deps}/share/emacs/site-lisp:" + ]; + + withEmacsPath = { emacsBin, briefcasePath ? "$HOME/briefcase" }: writeShellScriptBin "wpcarros-emacs" '' export XMODIFIERS=emacs export BRIEFCASE=${briefcasePath} export PATH="${emacsBinPath}:$PATH" - export EMACSLOADPATH="${wpcDir}:${vendorDir}:${wpcarrosEmacs.deps}/share/emacs/site-lisp:" + export EMACSLOADPATH="${loadPath}" exec ${emacsBin} \ --debug-init \ --no-site-file \ @@ -147,7 +154,7 @@ let "$@" ''; in { - inherit initEl; + inherit initEl withEmacsPath; # I need to start my Emacs from CI without the call to `--load ${initEl}`. runScript = { script, briefcasePath }: