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.
This commit is contained in:
Marien Zwart 2024-05-21 22:39:59 +10:00 committed by marienz
parent 23156c4b4c
commit 2562e36ad3
2 changed files with 4 additions and 1 deletions

View file

@ -340,6 +340,8 @@ let
# Use runCommand, not runCommandLocal, because makeBinaryWrapper pulls in a compiler.
doomEmacs = runCommand "doom-emacs" {
nativeBuildInputs = [ makeBinaryWrapper ];
# Expose this so we can push it to cachix.
inherit emacsWithPackages;
} ''
if [[ -z "${profileName}" ]]; then
profileArgs=()

View file

@ -111,12 +111,13 @@
}).doomEmacs;
# TODO: cache more packages, cache for more Emacsen.
cachix-packages = pkgs.linkFarm "unstraightened-cachix-packages" {
inherit doomemacs;
full-emacs29 = (doomFromPackages pkgs {
emacs = pkgs.emacs29;
doomDir = ./doomdirs/minimal;
doomLocalDir = "~/.local/share/nix-doom-unstraightened";
full = true;
}).doomEmacs;
}).doomEmacs.emacsWithPackages.deps;
};
});
overlays.default = final: prev: {