Build an option index from a flake-parts evaluation #4
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?
optionSymbolstakes an evaluatedoptionstree, anddocuments.nixproducesone with
home-manager.lib.homeManagerConfiguration. A flake-parts repositoryhas no single such tree: modules are written as
flake.modules.<class>.<name> = module, and the option trees only exist onceeach class is evaluated — nixos, darwin, homeManager, nixOnDroid — usually once
per host.
What is needed is the flake-parts equivalent of the
homehelper indocuments.nix: something that takes a flake's outputs and produces, perclass and per host, an evaluated
optionstree, plus a way to find which ofthose evaluations a given source file participates in.
Depends on the decision in "Decide what a card shows when one file is evaluated
many times" (#3).
Follows the decision in #3 (group by value across evaluations).
Shape: a helper that takes a flake's outputs and returns
{ <class>.<host> = options; }fromnixosConfigurations,darwinConfigurationsandhomeConfigurations(nixOnDroid when present). Which evaluations a file participates in is decided by whether any indexed option'sfilesordeclarationsnames that file, since the module system does not expose its collected module list (collectModulesinlib/modules.nixis internal).Prefixes per file come from the static side, see #2.