expose doom-emacs binaries in the main derivation

This commit is contained in:
ckie
2021-12-10 16:28:18 +02:00
parent d259993f6d
commit d639071134

View File

@@ -173,13 +173,19 @@ let
doom-emacs = stdenv.mkDerivation rec { doom-emacs = stdenv.mkDerivation rec {
name = "doom-emacs"; name = "doom-emacs";
src = doomSrc; src = doomSrc;
patches = [ patches = [
(substituteAll { (substituteAll {
src = ./nix-integration.patch; src = ./nix-integration.patch;
local = doomLocal; local = doomLocal;
}) })
]; ];
buildPhase = ":";
buildPhase = ''
patchShebangs bin
# Remove the windows wrapper for the CLI so the build doesn't fail
rm bin/doom.cmd
'';
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r * $out cp -r * $out
@@ -236,6 +242,11 @@ emacs.overrideAttrs (esuper:
wrapEmacs $prog wrapEmacs $prog
done done
# Doom comes with some CLIs (org-tangle, org-capture, doom)
for prog in ${doom-emacs}/bin/*; do
makeWrapper $prog $out/bin/"$(basename $prog)" --prefix PATH : $out/bin
done
if [[ -e $out/Applications ]]; then if [[ -e $out/Applications ]]; then
wrapEmacs "$out/Applications/Emacs.app/Contents/MacOS/Emacs" wrapEmacs "$out/Applications/Emacs.app/Contents/MacOS/Emacs"
fi fi