Add hack to use non-profile paths
This unsets DOOMPROFILE from inside the profile loader, which should result in Doom behaving as if we were not using profiles at all. I'm marking this experimental in part because it feels like a hack, and in part because this is not sufficient to fix `doom doctor`.
This commit is contained in:
parent
2babb2ed6a
commit
e602ad8bed
4 changed files with 15 additions and 3 deletions
|
|
@ -17,6 +17,10 @@ its const-ness is not enforced but I'd prefer not to take advantage of that. I
|
|||
also have not checked if writing the profile would work out of the box with this
|
||||
approach.
|
||||
|
||||
`noProfileHack` unsets `DOOMPROFILE` from the profile loader. This feels like a
|
||||
hack, but it does get us the usual `DOOMLOCALDIR`-relative `doom-cache-dir` and
|
||||
friends back.
|
||||
|
||||
## Why put `doom-user-dir`/`DOOMDIR` in the Nix store?
|
||||
|
||||
Doom forces my hand. I would prefer for just `packages.el` and possibly
|
||||
|
|
|
|||
|
|
@ -143,6 +143,10 @@ source.
|
|||
|
||||
When migrating from "normal" Doom, you may need to move some files around.
|
||||
|
||||
If this bothers you, you can try setting `noProfileHack = true`. This makes
|
||||
Unstraightened use the usual paths (relative to `doomLocalDir`), but is
|
||||
experimental.
|
||||
|
||||
## Comparison to `nix-doom-emacs`
|
||||
|
||||
- Unstraightened does not attempt to use straight.el at all. Instead, it uses
|
||||
|
|
|
|||
|
|
@ -18,14 +18,16 @@
|
|||
(defcli! build-profile-loader
|
||||
((profile-name ("-n" form) "Profile name.")
|
||||
(base-directory ("-b" dir) "Base directory (for profile and straight).")
|
||||
(profile-doom-dir ("-d" dir) "DOOMDIR"))
|
||||
(profile-doom-dir ("-d" dir) "DOOMDIR")
|
||||
(unset-profile ("-u") "Unset DOOMPROFILE at startup."))
|
||||
"Write Doom's profile loader."
|
||||
(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)))))
|
||||
("DOOMDIR" . ,profile-doom-dir)
|
||||
,@(when unset-profile '(("DOOMPROFILE" . nil)))))))
|
||||
(doom-profiles-save new-profiles)))
|
||||
|
||||
(run! "build-profile-loader" (cdr (member "--" argv)))
|
||||
|
|
|
|||
4
doom.nix
4
doom.nix
|
|
@ -37,6 +37,8 @@
|
|||
full ? false,
|
||||
/* Name of doom profile to use. */
|
||||
profileName ? "nix",
|
||||
/* Disable profile early in startup, so "normal" cache/state dirs are used. */
|
||||
noProfileHack ? false,
|
||||
|
||||
callPackages,
|
||||
git,
|
||||
|
|
@ -255,7 +257,7 @@ let
|
|||
# DOOMLOCALDIR must be writable, Doom creates some subdirectories.
|
||||
export DOOMLOCALDIR=$(mktemp -d)
|
||||
${runtimeShell} ${doomSource}/bin/doomscript ${./build-helpers/build-profile-loader} \
|
||||
-n "${profileName}" -b "$out" -d "${finalDoomDir}"
|
||||
-n "${profileName}" -b "$out" -d "${finalDoomDir}" ${optionalString noProfileHack "-u"}
|
||||
|
||||
# With DOOMPROFILE set, doom-state-dir and friends are HOME-relative.
|
||||
export HOME=$(mktemp -d)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue