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.
This commit is contained in:
Marien Zwart 2024-06-16 23:34:53 +10:00
parent f8012b8785
commit 2a436566e8
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View file

@ -204,7 +204,7 @@ let
# something package.el understands as satisfying dependencies.
# This is necessary if we're replacing a pinned ELPA dependency
# of an unpinned ELPA package.
esuper.melpaBuild {
(esuper.melpaBuild {
pname = name;
# melpaBuild requires we set `version` and `commit` here
# (leaving `version` unset until overrideAttrs below does not
@ -221,7 +221,15 @@ let
# TODO: refactor out the recursive call to makePackage.
# (Currently needed for dependencies on packages not in epkgs or doom.)
packageRequires = map (name: eself.${name} or (makePackage name {})) reqlist;
});
}).overrideAttrs (prev: {
# We only depend on this during evaluation. Force a dependency so it does not
# get garbage-collected, which slows down subsequent evaluation.
inherit reqfile;
postInstall = (prev.postInstall or "") + ''
mkdir -p $out/nix-support
ln -s $reqfile $out/nix-support/unstraightened-dependencies.json
'';
}));
url =
if (p.recipe.host or "") == "github" && p ? recipe.repo
then "https://github.com/${p.recipe.repo}"