Use filesets to improve caching

This commit is contained in:
Alex David 2026-01-28 13:06:37 -08:00
commit a06fc7d27f
2 changed files with 25 additions and 4 deletions

View file

@ -19,11 +19,18 @@
};
};
docsFileSet =
with lib.fileset;
toSource {
root = ../.;
fileset = ../lib;
};
formatCombinatorDoc =
name: combinatorObj:
let
attrPos = builtins.unsafeGetAttrPos "impl" combinatorObj;
file = lib.removePrefix (toString ./..) attrPos.file;
file = lib.removePrefix (toString docsFileSet) attrPos.file;
in
''
### ${name}
@ -37,7 +44,7 @@
combinatorDocs =
let
allCombinators =
(import ../lib/combinators.nix pkgs (throw "Docs must not depend on jail arg")).docs;
(import (docsFileSet + /lib/combinators.nix) pkgs (throw "Docs must not depend on jail arg")).docs;
formatSection =
filter: