mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Initial version of nixBufferBuilders.withPackages.
This builds elisp to setup an emacs buffer with the packages given available. See shlevy/nix-buffer for more information. Currently only modifies $PATH.
This commit is contained in:
parent
8f023eb129
commit
05c132486d
2 changed files with 22 additions and 0 deletions
20
pkgs/build-support/emacs/buffer.nix
Normal file
20
pkgs/build-support/emacs/buffer.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
# 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
|
||||
'';
|
||||
}
|
|
@ -285,6 +285,8 @@ in
|
|||
inherit kernel rootModules allowMissing;
|
||||
};
|
||||
|
||||
nixBufferBuilders = import ../build-support/emacs/buffer.nix { inherit (pkgs) runCommand; };
|
||||
|
||||
pathsFromGraph = ../build-support/kernel/paths-from-graph.pl;
|
||||
|
||||
srcOnly = args: callPackage ../build-support/src-only args;
|
||||
|
|
Loading…
Reference in a new issue