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

@ -276,14 +276,14 @@ let
# Required to avoid Doom erroring out at startup.
nativeBuildInputs = [ git ];
} ''
mkdir $out $out/loader $out/profile
mkdir $out $out/loader $out/profile $out/straight
export DOOMPROFILELOADFILE=$out/loader/init.el
export DOOMLOCALDIR=$(mktemp -d)
# Prevent error on Emacs shutdown writing empty build cache.
mkdir $DOOMLOCALDIR/straight
${runtimeShell} ${doomSource}/bin/doomscript ${./build-helpers/build-profile-loader} \
-n "${profileName}" -p "$out/profile" -d "${finalDoomDir}"
-n "${profileName}" -b "$out" -d "${finalDoomDir}"
# With DOOMPROFILE set, doom-state-dir and friends are HOME-relative.
export HOME=$(mktemp -d)