From 638118e72dd49e1b3f9b970f08141bf181f18493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Thu, 18 Jun 2020 10:51:41 +0200 Subject: [PATCH] override `emacsWithPackages` instead of wrapping it This way all conditional outputs e.g. the MacOS App will be present in the final derivation. See: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/emacs/wrapper.nix#L162 Resolves: #14 --- default.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index eb1c857..dd8ffa6 100644 --- a/default.nix +++ b/default.nix @@ -172,19 +172,17 @@ let load-config-from-site ])); in -pkgs.runCommand "doom-emacs" { - inherit emacs; - buildInputs = [ emacs ]; - nativeBuildInputs = [ makeWrapper ]; -} '' - mkdir -p $out/bin - for prog in $emacs/bin/*; do - makeWrapper $prog $out/bin/$(basename $prog) --set DOOMDIR ${doomDir} +emacs.overrideAttrs (esuper: { + buildCommand = esuper.buildCommand + '' + for prog in $out/bin/*; do + wrapProgram $out/bin/$(basename $prog) --set DOOMDIR ${doomDir} done # emacsWithPackages assumes share/emacs/site-lisp/subdirs.el # exists, but doesn't pass it along. When home-manager calls # emacsWithPackages again on this derivation, it fails due to # a dangling link to subdirs.el. # https://github.com/NixOS/nixpkgs/issues/66706 - ln -s ${emacs.emacs}/share $out - '' + rm -rf $out/share + ln -s ${esuper.emacs}/share $out + ''; +})