Discover pages and their option prefixes instead of listing them by hand #2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
documents.nixnames every page by hand, and each entry hand-writes theprefixeswhose options it wants indexed and thepackagesit wants positionsfor. The header
navis a flat list of every page.That is fine for five documents and unusable for a repository with hundreds of
.nixfiles: the list becomes a second source of truth that drifts from thetree, and a flat nav of 218 entries is not navigable.
Three separate things are needed:
actually touched.
prefixesderived from what the file itself declares or defines. Theevaluator already knows:
option.declarationPositionssays which filedeclares an option and
definitionsWithLocationssays which file defines it,so the set of options a page cares about is computable rather than written
down.
packagescannot be derived this way —pkgsis not enumerable — soit stays declared.
in the header.
Tested the evaluator route for deriving
prefixesand it does not work: walking the wholeoptionstree while touching onlyfiles/declarationsis not total on aarch64-darwin.tryEvalaround every node still dies withattribute 'google-chrome-beta' missing(home-manager's chromium module), because a missing attribute is not caught bytryEval. And there is no API for the list of modules an evaluation collected.Revised plan, in three parts:
prefixesderived statically.extract.pyalready resolves every identifier a file touches to aconfig.*/options.*path, so the set of those paths is the file's prefixes. Total, cheap, and independent of the evaluator.packagesstays declared.files/declarations.documents.nixthen names evaluations, not pages.