Merge branch 'develop' into master

This commit is contained in:
László Vaskó
2020-10-04 11:56:11 +02:00
3 changed files with 48 additions and 9 deletions

View File

@ -7,6 +7,12 @@
;;; have a properly configured user home and environment. ;;; have a properly configured user home and environment.
(setq package-check-signature nil) (setq package-check-signature nil)
;;; For gccEmacs compatibility
(with-eval-after-load "comp"
;; The advice for 'kill-emacs would result in eln files being written before
;; doom would set up proper load paths
(add-to-list 'comp-never-optimize-functions 'kill-emacs))
(defun nix-straight-inhibit-kill-emacs (arg) (defun nix-straight-inhibit-kill-emacs (arg)
(message "[nix-doom-emacs] Inhibiting (kill-emacs)")) (message "[nix-doom-emacs] Inhibiting (kill-emacs)"))

View File

@ -91,6 +91,13 @@ let
''; '';
}; };
fmt = {
reset=''\\033[0m'';
bold=''\\033[1m'';
red=''\\033[31m'';
green=''\\033[32m'';
};
# Bundled version of `emacs-overlay` # Bundled version of `emacs-overlay`
emacs-overlay = import (lock "emacs-overlay") pkgs pkgs; emacs-overlay = import (lock "emacs-overlay") pkgs pkgs;
@ -140,6 +147,22 @@ let
preInstall = '' preInstall = ''
export DOOMDIR=${doomPrivateDir} export DOOMDIR=${doomPrivateDir}
export DOOMLOCALDIR=$out/ export DOOMLOCALDIR=$out/
# Create a bogus $HOME directory because gccEmacs is known to require
# an existing home directory because the async worker process don't
# fully respect the value of 'comp-eln-load-path'.
export HOME=$(mktemp -d)
'';
postInstall = ''
# If gccEmacs or anything would write in $HOME, fail the build.
if [[ -z "$(find $HOME -maxdepth 0 -empty)" ]]; then
printf "${fmt.red}${fmt.bold}ERROR:${fmt.reset} "
printf "${fmt.red}doom-emacs build resulted in files being written in "'$HOME'" of the build sandbox.\n"
printf "Contents of "'$HOME'":\n"
find $HOME
printf ${fmt.reset}
exit 33
fi
''; '';
}); });
@ -169,7 +192,11 @@ let
mkdir -p $out mkdir -p $out
cp -r ${doomPrivateDir}/* $out cp -r ${doomPrivateDir}/* $out
chmod u+w $out/config.el chmod u+w $out/config.el
cat $extraConfigPath >> $out/config.el cat $extraConfigPath > $out/config.extra.el
cat > $out/config.el << EOF
(load "${builtins.toString doomPrivateDir}/config.el")
(load "$out/config.extra.el")
EOF
''; '';
# Stage 5: catch-all wrapper capable to run doom-emacs even # Stage 5: catch-all wrapper capable to run doom-emacs even
@ -187,14 +214,10 @@ let
])); ]));
build-summary = writeShellScript "build-summary" '' build-summary = writeShellScript "build-summary" ''
BOLD=\\033[1m printf "\n${fmt.green}Successfully built nix-doom-emacs!${fmt.reset}\n"
GREEN=\\033[32m printf "${fmt.bold} ==> doom-emacs is installed to ${doom-emacs}${fmt.reset}\n"
RESET=\\033[0m printf "${fmt.bold} ==> private configuration is installed to ${doomDir}${fmt.reset}\n"
printf "${fmt.bold} ==> Dependencies are installed to ${doomLocal}${fmt.reset}\n"
printf "\n''${GREEN}Successfully built nix-doom-emacs!''${RESET}\n"
printf "''${BOLD} ==> doom-emacs is installed to ${doom-emacs}''${RESET}\n"
printf "''${BOLD} ==> private configuration is installed to ${doomDir}''${RESET}\n"
printf "''${BOLD} ==> Dependencies are installed to ${doomLocal}''${RESET}\n"
''; '';
in in
emacs.overrideAttrs (esuper: emacs.overrideAttrs (esuper:

View File

@ -26,3 +26,13 @@ index c8cfb0495..d8ed107bd 100644
"Directory for volatile local storage. "Directory for volatile local storage.
Use this for files that change often, like cache files. Must end with a slash.") Use this for files that change often, like cache files. Must end with a slash.")
@@ -276,7 +276,8 @@ config.el instead."
;; Don't store eln files in ~/.emacs.d/eln-cache (they are likely to be purged
;; when upgrading Doom).
(when (boundp 'comp-eln-load-path)
- (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/")))
+ (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/"))
+ (add-to-list 'comp-eln-load-path (concat doom-local-dir "cache/eln/")))
(after! comp
;; HACK `comp-eln-load-path' isn't fully respected yet, because native