Commit graph

372 commits

Author SHA1 Message Date
Marien Zwart
2cc2bdaf63
Fix excessively long lines
This keeps nix code within 100 columns except for one string in a
comment.
2024-05-07 23:19:43 +10:00
Marien Zwart
c12417c362
Rename doom.nix to default.nix 2024-05-07 23:02:59 +10:00
Marien Zwart
badafb50f6
Appease statix 2024-05-07 22:59:57 +10:00
Marien Zwart
a435bdc848
Use nix-systems
Not hugely important because it only affects our packages, not overlay
or home-manager module, but might as well.
2024-05-07 22:58:41 +10:00
Marien Zwart
0d1f14d15a
Disable nixpkgs inputs of doom-overlay
They should be unused as all we're using is the overlay. Let's make that
explicit.
2024-05-07 22:36:33 +10:00
Marien Zwart
9ce8bbd4ce
nix flake update 2024-05-04 22:49:22 +10:00
Marien Zwart
c8b82d46ba
Use emacs-overlay directly, not as overlay
Slight hack to avoid instantiating an additional nixpkgs unnecessarily.
2024-05-04 22:48:11 +10:00
Marien Zwart
0dd5a3d425
Appease statix 2024-04-29 15:46:56 +10:00
Marien Zwart
b3ed7ea627
Add a Home Manager module
It turns out using Home Manager's `programs.emacs` module does not work
correctly. Document that in HACKING.md for future reference.
2024-04-29 15:46:13 +10:00
Marien Zwart
7848f69115
Document some known doom doctor complaints 2024-04-29 14:19:43 +10:00
Marien Zwart
19d0b562de
nix flake update 2024-04-28 20:30:37 +10:00
Marien Zwart
c13337d454
Wrap doom CLI
Enough of this now works. In particular, it is possible to run `doom
doctor`.
2024-04-28 20:19:46 +10:00
Marien Zwart
6b8ff7b693
Advice doom-profile-init-file to use our profile
`doom-start` locates the profile init file relative to
`doom-profile-dir` when running interactively, which we customize (either
directly or by setting `doom-profile-data-dir`). But when running
noninteractively, it uses `doom-profile-init-file`, which always loads
relative to `doom-data-dir`.

We cannot point `doom-data-dir` into the store, so this breaks us.

Work around it by advicing `doom-profile-data-dir` to locate the init
file relative to `doom-profile-dir` too. Try to make this more safe by
erroring out if called on a non-default profile.

All of this feels questionable, but I really want `doom doctor` to
work...
2024-04-28 20:11:51 +10:00
Marien Zwart
24ee7b6838
Actually load straight when asked to initialize it
`straight--load-build-cache` is not autoloaded, so we fail if it has not
been loaded yet. Apparently it usually is when we hit this override
interactively, but Doom CLI can call our override early enough we need
this.
2024-04-28 20:09:06 +10:00
Marien Zwart
87267ca824
Make profile loader optional
Not heavily tested, but seems to work.
2024-04-28 18:59:38 +10:00
Marien Zwart
7c5ee461be
Don't force DOOMDIR and DOOMPROFILE* on doomscript
It does not use them (although doomscripts themselves might).

Not forcing them seems more convenient for users (this should let me
test build-profile-loader) and helps me make the profile loader
optional.
2024-04-28 17:54:11 +10:00
Marien Zwart
61839cf1ab
Set DOOMDIR in the wrapper, not the profile loader
Both approaches are about equivalent, but since I'm trying to make the
profile loader optional and there's no way I can make the wrapper
optional, let's move this around...
2024-04-28 17:44:19 +10:00
Marien Zwart
e942e9db3b
Use --subst-var-by (looks nicer) 2024-04-28 17:36:21 +10:00
Marien Zwart
603c36e90c
Simplify setting straight-base-dir
Instead of passing the path down from the profile loader to init.el,
just substitute the path into init.el.

This requires moving DOOMDIR generation into the same derivation as
profile build to avoid a circular dependency.
2024-04-28 17:33:43 +10:00
Marien Zwart
5049ed0665
Clarify Emacs version requirement
And stop forcing pgtk for the example packages.
2024-04-28 16:54:00 +10:00
Marien Zwart
a784fcdbe9
Install doomscript in emacsWithDoom 2024-04-28 16:50:58 +10:00
Marien Zwart
e602ad8bed
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`.
2024-04-28 16:39:50 +10:00
Marien Zwart
2babb2ed6a
Chain-load user init.el instead of embedding it
Mostly to avoid sticking our copyright header on top of the user's
init.el.
2024-04-28 15:23:31 +10:00
Marien Zwart
a4d7407509
Add CONTRIBUTING instructions 2024-04-28 12:48:38 +10:00
Marien Zwart
198f0cb432
Add required disclaimer 2024-04-28 12:34:22 +10:00
Marien Zwart
727bcf40e4
Add LICENSE (and license headers) 2024-04-28 12:26:05 +10:00
Marien Zwart
0b1947effc
Install doomscript
Convenient for testing our build helpers.
2024-04-27 21:41:50 +10:00
Marien Zwart
7d16c1db5e
Whitespace/comment tweaks 2024-04-27 21:34:44 +10:00
Marien Zwart
c09022717d
Pull fetch overrides out of doom.nix
No reason, they just felt out of place.
2024-04-27 21:28:39 +10:00
Marien Zwart
68d5ec704b
Add script to check for byte-compile failures
Just a manual check for now.
2024-04-27 21:25:29 +10:00
Marien Zwart
54c396f24b
Drop unnecessary TODO
Info already works: Doom has `Info-directory-list` in
`doom-autoloads-cached-vars`, which seems to be all that's required.
2024-04-27 20:15:03 +10:00
Marien Zwart
45568feecf
Tweak comment, dropping stale TODO
Buliding an empty autoloads file is harmless. Removing it would only
have been useful if I was able to skip straight.el initialization
entirely: now that I'm storing its build cache it no longer helps.
2024-04-27 20:02:15 +10:00
Marien Zwart
a42fbea20d
Tweak README wording
I was overstating how many packages Doom leaves unpinned.
2024-04-27 19:55:46 +10:00
Marien Zwart
862177c24f
Add more documentation 2024-04-27 17:59:26 +10:00
Marien Zwart
d9aad25bec
Add emacsWithDoom to overlay 2024-04-27 16:14:28 +10:00
Marien Zwart
1399755050
Require init.el exists
Although a completely empty DOOMDIR seems to work (at least for build
purposes), I doubt Doom actually supports this. And it requires some
extra checks on our side as well.

Just check in a trivial DOOMDIR and use that instead.
2024-04-27 14:53:17 +10:00
Marien Zwart
f8fcb9f904
Drop obsolete temp dir creation
Since we're writing the straight.el build cache to the profile now, the
build process using $DOOMLOCALDIR/straight would be a bug. Stop creating
it.
2024-04-27 14:31:24 +10:00
Marien Zwart
974aaf2160
Refactor some elisp out of doom.nix
Just for readability, no functional change.
2024-04-27 14:21:34 +10:00
Marien Zwart
c59e95e5d9
nix flake update 2024-04-27 13:17:21 +10:00
Marien Zwart
708e180792
Make Doom search config with ripgrep, not git
Doom's package help uses `git grep` to search for files in Doom
configuring a package, which does not work for us because our Doom
install does not live in a Git checkout. Unfortunately this breaks
package help completely because of error handling problems.

Add advice to use ripgrep instead, which fixes package help.

I don't like doing this: I've sent the same fix upstream, if it's not
accepted there I may just make Doom in the Nix store be a Git checkout.
2024-04-27 13:12:47 +10:00
Marien Zwart
80e6ef0d25
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.
2024-04-27 13:06:46 +10:00
Marien Zwart
f150fe6c89
Expose doomEmacs as an overlay
Exposing it as a package was (at least according to `nix flake check`)
incorrect.

This means we now use the user's nixpkgs's `pkgs.callPackage` instead of
our own, but I think that's ok.
2024-04-25 23:27:49 +10:00
Marien Zwart
7ccd40f8b0
Add a TODO about doom doctor support 2024-04-25 22:49:58 +10:00
Marien Zwart
cd68c073ed
Add some more documentation 2024-04-25 22:49:42 +10:00
Marien Zwart
300ccb8da3
Add some more documentation 2024-04-25 22:24:16 +10:00
Marien Zwart
7fe4e9e170
Restore capitalization
I somehow managed to lowercase build-profile and build-profile-loader
when I split them out of cli2.el. Undo this.

The only load-bearing capitalization was DOOMDIR in the profile loader.
Everything else was comments and docstrings.
2024-04-25 20:33:33 +10:00
Marien Zwart
7c5144178b
Remove unused import 2024-04-25 17:51:24 +10:00
Marien Zwart
7d4248f310
Pass profile name as env var, not argument
Fixes `emacs --batch`: Doom does not process the --profile argument when
non-interactive, causing Emacs to complain about the unrecognized option.
2024-04-25 17:11:07 +10:00
Marien Zwart
9e9c822ec2
Fix build of doom-minimal / doom-full
This broke a while back without me noticing. I should set up proper
tests...
2024-04-25 17:00:39 +10:00
Marien Zwart
bc288fad83
Use doomscript instead of cli.el for profile build
Our cli.el ended up in the profile used at runtime. Although we could
have fixed overwriting a user's cli.el by appending to it, that still
would have leaked our build commands into the build.

This approach should be equivalent and reduces our profile modifications
to replacing packages.el (which is kind of the point) and prepending to
init.el (unfortunate, but seemingly necessary).
2024-04-25 16:23:55 +10:00