mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-03 12:27:27 -05:00
If built with gccEmacs, in `straight--native-compile-package` step tries to access $HOME because `comp-eln-load-path` contains "~/.emacs.d/eln-cache/". It errors on this as it is set to a readonly canary value of `/homeless-shellter` in the nix build sandbox. The workaround is twofold: * Ignore `kill-emacs` from optimization. It would result in eln file being written before doom sets up the load path outside of HOME. * The above solution doesn't help in the actual build phase because the worker processes compiling packages does not inherit this value but it is set in them at a later time. This causes the build to fail before `comp-eln-load-path` would be successfully overridden. Having a writable $HOME does not seem to produce any build output there hence the override and the check in `postInstall` to verify that the directory is indeed empty. The runtime value of `comp-eln-load-path` also had to be changed because it is by default is located under the volatile `doom-cache-dir` which is not a part of the derivation so the build time generated `.eln` files couldn't be loaded from that. References: #57
38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
diff --git a/core/core.el b/core/core.el
|
|
index c8cfb0495..d8ed107bd 100644
|
|
--- a/core/core.el
|
|
+++ b/core/core.el
|
|
@@ -92,20 +92,20 @@ envvar will enable this at startup.")
|
|
(defconst doom-local-dir
|
|
(if-let (localdir (getenv "DOOMLOCALDIR"))
|
|
(expand-file-name (file-name-as-directory localdir))
|
|
- (concat doom-emacs-dir ".local/"))
|
|
+ "@local@/")
|
|
"Root directory for local storage.
|
|
|
|
Use this as a storage location for this system's installation of Doom Emacs.
|
|
These files should not be shared across systems. By default, it is used by
|
|
`doom-etc-dir' and `doom-cache-dir'. Must end with a slash.")
|
|
|
|
-(defconst doom-etc-dir (concat doom-local-dir "etc/")
|
|
+(defconst doom-etc-dir "~/.local/doom/"
|
|
"Directory for non-volatile local storage.
|
|
|
|
Use this for files that don't change much, like server binaries, external
|
|
dependencies or long-term shared data. Must end with a slash.")
|
|
|
|
-(defconst doom-cache-dir (concat doom-local-dir "cache/")
|
|
+(defconst doom-cache-dir "~/.cache/doom/"
|
|
"Directory for volatile local storage.
|
|
|
|
Use this for files that change often, like cache files. Must end with a slash.")
|
|
@@ -276,7 +276,7 @@ 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-local-dir "cache/eln/")))
|
|
|
|
(after! comp
|
|
;; HACK `comp-eln-load-path' isn't fully respected yet, because native
|