diff options
author | Erik Arvstedt <erik.arvstedt@gmail.com> | 2022-09-05 12:11:43 +0200 |
---|---|---|
committer | Erik Arvstedt <erik.arvstedt@gmail.com> | 2022-09-05 12:11:43 +0200 |
commit | 9f22df9a7f575a172bfd222e9c01296bc9df3e6d (patch) | |
tree | cfe27bde4a50fc18019749a5a40560d98fd1f248 /lib/modules.nix | |
parent | faf9c2b0a746ef13f2eadc4f7766658992db72d6 (diff) |
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`.
Diffstat (limited to 'lib/modules.nix')
-rw-r--r-- | lib/modules.nix | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index d3a7fac82c4ab..b6751d17f8f45 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -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; |