Revert "emacs/wrapper.nix: expose extra package binaries via PATH"

This reverts commit 7bd6dfde2f.

The idea of using PATH to provide binaries added via withPackages is
good, but I think this specific implementation can be improved:

- When PATH is used, there is no need to modify exec-path any more
  because exec-path is initialized from PATH.
- Setting PATH in wrapper.sh, together with other environment
  variables, is more maintainable.
This commit is contained in:
Lin Jian
2026-09-27 18:10:00 +08:00
parent e158d9ed9b
commit 0f59a83e3b

View File

@@ -174,13 +174,6 @@ runCommand (lib.appendToName "with-packages" emacs).name
;; "$out/share/emacs/site-lisp" is added to load-path in wrapper.sh
;; "$out/share/emacs/native-lisp" is added to native-comp-eln-load-path in wrapper.sh
(add-to-list 'exec-path "$out/bin")
;; Also expose extra package binaries via PATH so that subprocesses
;; which rebuild their environment from PATH (e.g. direnv/envrc) can
;; still find them. See https://github.com/purcell/envrc/issues/9
(let ((deps-bin "$out/bin")
(current-path (or (getenv "PATH") "")))
(unless (member deps-bin (split-string current-path path-separator))
(setenv "PATH" (concat deps-bin path-separator current-path))))
${lib.optionalString withTreeSitter ''
(add-to-list 'treesit-extra-load-path "$out/lib/")
''}