mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 00:33:10 +00:00
05c132486d
This builds elisp to setup an emacs buffer with the packages given available. See shlevy/nix-buffer for more information. Currently only modifies $PATH.
21 lines
748 B
Nix
21 lines
748 B
Nix
# Functions to build elisp files to locally configure emcas buffers.
|
|
# See https://github.com/shlevy/nix-buffer
|
|
|
|
{ runCommand }:
|
|
|
|
{
|
|
withPackages = pkgs: runCommand "dir-locals.el" { inherit pkgs; } ''
|
|
echo "(make-local-variable 'process-environment)" >> $out
|
|
echo "(setenv \"PATH\" (concat" >> $out
|
|
for pkg in $pkgs; do
|
|
echo " \"$pkg/bin:$pkg/sbin\"" >> $out
|
|
done
|
|
echo " (getenv \"PATH\")))" >> $out
|
|
echo -n "(setq-local exec-path (append '(" >> $out
|
|
for pkg in $pkgs; do
|
|
echo -en "\n \"$pkg/bin\" \"$pkg/sbin\"" >> $out
|
|
done
|
|
echo -e ")\\n exec-path))" >> $out
|
|
'';
|
|
}
|