Commit graph

35 commits

Author SHA1 Message Date
Marien Zwart
969837731b
Use sourcehut fetcher
It looks like sourcehut does not allow shallow clones of arbitrary revs
either. Use Nix's experimental archive fetcher for more optimal fetches.
2024-07-02 22:15:19 +10:00
Marien Zwart
37da9ce045
Extend/generalize shallow clone avoidance
Savannah seems to have the same problem.

CI fails for emms. Extend to all of savannah as we'll presumably hit
this for several other packages next...
2024-07-02 21:59:49 +10:00
Marien Zwart
1d61287aff
Avoid shallow clone of notmuch
Shallow clones are the default in Nix 2.23, but the Git server for
notmuch does not seem to allow shallow clones of specific revisions.

Disable them, which should make no difference for Nix < 2.23.

This is mostly to (hopefully) unblock CI. If this fixes it, I should
investigate if it is possible for Nix to fall back to a full clone in
this scenario.
2024-07-02 21:41:10 +10:00
Marien Zwart
cc97ee52b2
Prefer pinned URLs over emacs-overlay URLs
Similar to what 5e2835bffe did for pins.

Necessary to make the emacs-ansible URL override in
0b124de235 actually work.
2024-06-27 22:36:36 +10:00
Marien Zwart
9205f2878f
Stop forcing HEAD as ref
This may be contributing to #14.
2024-06-26 22:48:17 +10:00
Marien Zwart
5e2835bffe
Make extraPins override Doom pins
So it can be used to override conflicting pins for packages built from
the same repo.
2024-06-22 21:54:11 +10:00
Marien Zwart
fa6fe4cf93
Load non-packages.el autoloads
We were only pulling in autoloads files for packages installed via
packages.el. This was not that noticeable because all pinned packages
without custom derivations end up installed that way, but it does affect
extra packages (including the one pointed out in #11).

Try to fix this by including autoloads files in the top-level site-lisp
directory from emacsWithPackages.
2024-06-22 13:30:32 +10:00
Marien Zwart
2a436566e8
Force a dependency on generated dependencies json
This otherwise gets garbage-collected and then has to be regenerated on
next flake evaluation. It may not be that slow to regenerate, but it's
also tiny enough we may as well keep it alive.
2024-06-16 23:40:58 +10:00
Marien Zwart
c61cd622b7
Add extraBinPackages for adding to $PATH
and use it to make sure Doom's essential prerequisites are available.
2024-06-16 22:41:03 +10:00
Marien Zwart
e69e5ed23e
Move most shell out of Nix string literals
The amount of shell in non-shell files was making me uncomfortable,
and two of these previously contained awkward `''$` escapes.

Apart from forcing one more step to run locally, this is just moving
code around.
2024-06-07 21:15:36 +10:00
Marien Zwart
9f249ae72f
Push noProfileHack handling to bash
Gets rid of the last string substitution.
2024-06-07 21:15:35 +10:00
Marien Zwart
ce63f7f54a
Prefer --subst-var over --subst-var-by
Rename a few other template vars to remain consistent.
2024-06-07 21:15:33 +10:00
Marien Zwart
8f8f118d94
Use derivation attributes
Mostly removes string interpolation from build commands, by mechanically
pushing inputs up to derivation attributes.

Should be equivalent, but makes the derivations more readable (and
potentially allows splitting build commands out to separate files).
2024-06-07 21:15:29 +10:00
Marien Zwart
b16774f129
Refactor full init.el building 2024-06-07 21:15:22 +10:00
Marien Zwart
9d01c40caf
Split off doomscript execution helper 2024-06-07 21:14:19 +10:00
Thomas Schwanberger
4715b1e127 Fix extraneous whitespaces 2024-06-02 01:21:24 +02:00
Thomas Schwanberger
9aca28b012 Support specifying extra emacs pkgs from nixpkgs 2024-06-02 00:36:15 +02:00
Marien Zwart
f48edf8b34
Test against init.el with all module flags enabled
Detect module flags by walking package.el files.

This still does not build all dependencies, because some are enabled
only if some flag or other module is disabled. But this should be close.
2024-05-27 20:11:06 +10:00
Marien Zwart
91e89099d2
Assume recipe type is git if not specified
Fixes fetch failure for x-face-e21.

Noticed through upcoming improvement to test coverage.
2024-05-27 20:11:03 +10:00
Marien Zwart
48ba3bb39c
Rename doomDirWithAllPackages -> ...Modules 2024-05-27 20:11:01 +10:00
Marien Zwart
313b9ef400
Remove "full" build flag
No longer used.
2024-05-27 20:10:59 +10:00
Marien Zwart
3f2a482afd
Test with a generated init.el with all modules
...not yet with all flags, but that's the next step.

This surfaced several problems not caught by the existing "full" build,
because that did not enable dependencies conditionally enabled if a
second module is enabled.

There are a small number of dependencies only enabled if a second module
is *not* enabled, which I intend to add some manual tests for.
2024-05-27 20:08:17 +10:00
Marien Zwart
a0bdac47f7
Handle non-github git recipes
Used by ob-clojure-literate.

Noticed through upcoming test coverage improvement.
2024-05-27 20:08:13 +10:00
Marien Zwart
dbd9b1e998
Don't try to use our custom packages unless pinned
They do not have src set, so if we pull them in without having a pin
they fail to build.

Noticed with org, so add a test for that. Probably not the only one
affected, though.

Fixes #4
2024-05-27 20:08:08 +10:00
Marien Zwart
2af26fcfa1
Use fetchTree / github fetcher for CI
This seems to be much more space-efficient: ~/.cache/nix/tarball-cache
is about 700MiB uncompressed, under 300MiB as tzst (using tar's
defaults, CI uses zstdmt but I assume will be in the same ballpark). The
gitv3 cache is multiple GiB.

CI will still build doom-example using fetchGit. I intend to shrink the
number of modules enabled in the example to keep gitv3 cache size under
control.
2024-05-26 22:42:51 +10:00
Marien Zwart
645f79a916
Disable submodule fetching by default
This may turn out to be too much (but it does at least build).

Motivation: CI's git checkouts consume an unmanageably large amount of
cache (over 3 GiB per snapshot out of 10 GiB quota), and must be cached
for acceptable build speeds. Dropping submodules should help somewhat
directly, but I want to try switching most of CI over to fetchTree's
github fetcher, which won't include submodules. This change should help
maintain parity.

I'm also seeing a submodule fetch failure in CI (for stan-mode) that I
may not need to debug if the package functions without that submodule.
2024-05-26 22:06:07 +10:00
Marien Zwart
2f89220bdc
Try to work around Git caching issue in newer Nix
After upgrading my local Nix from 2.18 to 2.22, evaluating
Unstraightened became very slow. I think this is a bug in
Nix (https://github.com/NixOS/nix/issues/10773), and it may explain
the slowness I've been seeing in CI.

Attempt to work around this by unconditionally passing `ref` to
`fetchGit`. This seems like it should not do anything, since we also
pass a `rev` and set `allRefs = true`, but it does work around the
caching issue (mostly... it looks like submodules still hit it).

Tested locally in both Nix 2.18 and Nix 2.22. I did see some odd
warnings with 2.18 (`warning: refname
'e4031935803c66eca2f076dce72b0a6a770d026c' is ambiguous`), but only for
one refname and they did not recur. Ignore that for now.
2024-05-25 13:18:29 +10:00
Marien Zwart
6401eecb57
Always fetch allRefs
Having CI confirm allRefs false is still safe would require a network
hit for each repo, which is already problematic. But
https://github.com/NixOS/nix/issues/7120 means we'd need to drop CI's
cached content, not just its cached refs: given how much we're fetching
that seems too much.

Fetch all refs unconditionally, assuming we're typically re-fetching the
same fixed rev repeatedly, which should be cached.
2024-05-25 12:46:43 +10:00
Marien Zwart
2562e36ad3 CI: micro-optimize cachix build
The doom profile is a non-negligible fraction of the cachix binary size,
that will only get worse (any dependency change will trigger a rebuild),
and caching them is essentially useless.

Expose emacsWithPackages so we can push just that. Skip
emacsWithPackages itself and push just the -deps derivation while we're
at it: caching either emacsWithPackages or -deps is similarly useless,
but they are a bit smaller.

When I say "non-negligible", it's about 1 MiB per "full" profile: much
larger than most individual libraries but not actually large. So this is
really a micro-optimization.
2024-05-23 20:16:15 +10:00
Marien Zwart
4cf47c2fa7
Fix dependencies on unknown packages
Triggered by ob-ammonite (used by scala, in emacsattic) depending on
ammonite-term-repl (also in emacsattic). `eself` only contains
emacs-overlay and doomPackageSet.

All of this needs refactoring, but an explicit recursive call fixes the
immediate problem.
2024-05-22 23:41:07 +10:00
Marien Zwart
cbe7d2586a Attempt to fix emms
CI fails to fetch it:

```
error: Server does not allow request for unadvertised object 87d0d1fb0566a80229029d0d8d7c863138d70aae
warning: could not update mtime for file '/home/runner/.cache/nix/gitv3/0gjpwip102kwcvz961gsiva3lqmmr6266s5wzs8kq0ybm68gwpx9/refs/heads/master': No such file or directory
error:
       … while checking flake output 'checks'
         at /nix/store/fwrwzxjvvpx1l27h8j5f9gffzwn2vdik-source/flake.nix:54:7:
           53|     in {
           54|       checks = perSystemPackages (pkgs:
             |       ^
           55|         let
       … while checking the derivation 'checks.x86_64-linux.full'
         at /nix/store/fwrwzxjvvpx1l27h8j5f9gffzwn2vdik-source/flake.nix:83:11:
           82|           })).emacsWithDoom;
           83|           full = mkDoom {
             |           ^
           84|             full = true;
       (stack trace truncated; use '--show-trace' to show the full trace)
       error: Cannot find Git revision '87d0d1fb0566a80229029d0d8d7c863138d70aae' in ref 'refs/heads/master' of repository 'https://git.savannah.gnu.org/git/emms.git'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.
```

Try to follow the suggestions from the error message, as I do see the
commit in https://git.savannah.gnu.org/cgit/emms.git/.

I'm not sure why this is only failing now...
2024-05-18 22:20:56 +10:00
Marien Zwart
482f7f3c7f
Apply pins per-repo
I knew this might cause problems at some point, but it came to a head
sooner than expected: it triggered
https://github.com/magit/magit/issues/5131 (magit is pinned but
magit-section was not, and those packages expect to be kept in sync).

The fix is messier than I'd like but at least fixes magit.
2024-05-13 22:09:28 +10:00
Marien Zwart
8b4fc00d8e
Use runCommandLocal 2024-05-11 21:32:48 +10:00
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
Renamed from doom.nix (Browse further)