Provide straight--build-cache

Add an (empty) straight.el build cache to the generated profile, and
load it when Doom calls `doom-initialize-core-packages` (which normally
does so by side effect).

Unfortunately requires adding to pre-init: Doom overrides
`straight-base-dir`, and we need to override that override.

Partially fixes package help.
This commit is contained in:
Marien Zwart 2024-04-27 13:06:46 +10:00
parent f150fe6c89
commit 80e6ef0d25
No known key found for this signature in database
3 changed files with 17 additions and 8 deletions

View file

@ -3,13 +3,15 @@
(defcli! build-profile-loader
((profile-name ("-n" form) "Profile name.")
(profile-directory ("-p" dir) "Profile data directory.")
(base-directory ("-b" dir) "Base directory (for profile and straight).")
(profile-doom-dir ("-d" dir) "DOOMDIR"))
"Write Doom's profile loader."
(let ((new-profiles `((,profile-name
(user-emacs-directory . ,doom-emacs-dir)
(doom-profile-data-dir . ,profile-directory)
("DOOMDIR" . ,profile-doom-dir)))))
(let* ((profile-directory (expand-file-name "profile/" base-directory))
(new-profiles `((,profile-name
(user-emacs-directory . ,doom-emacs-dir)
(doom-profile-data-dir . ,profile-directory)
(unstraightened--straight-base-dir . ,base-directory)
("DOOMDIR" . ,profile-doom-dir)))))
(doom-profiles-save new-profiles)))
(run! "build-profile-loader" (cdr (member "--" argv)))