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
This is needed as custom packages may need the same treatment as
built-in dependencies of doom. See `./overrides.nix` for details.
The `bundledPackages` option may be consolidated to use this argument as
well in the future.
References: #55
Newer doom versions (after 873fc5c0db4876d9e1f347fa6cbd2a3a1933df69) has
a rewritten cli interface. I could not figure out how to pass `--no-env`
and `--no-fonts` (should check later if it is a bug in doom)