mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
lib/modules: add definitionsWithLocations
to evaluated options
This attr provides the location of each definition. This is particularly useful for introspecting options of type `attrsOf`. E.g., it allows finding the location of a systemd service definition by parsing `options.systemd.services.definitionsWithLocations`.
This commit is contained in:
parent
faf9c2b0a7
commit
9f22df9a7f
@ -720,6 +720,7 @@ rec {
|
||||
inherit (res.defsFinal') highestPrio;
|
||||
definitions = map (def: def.value) res.defsFinal;
|
||||
files = map (def: def.file) res.defsFinal;
|
||||
definitionsWithLocations = res.defsFinal;
|
||||
inherit (res) isDefined;
|
||||
# This allows options to be correctly displayed using `${options.path.to.it}`
|
||||
__toString = _: showOption loc;
|
||||
|
Loading…
Reference in New Issue
Block a user