3 discardPositions = lib.mapAttrs (k: v: v);
5 # unsafeGetAttrPos is unspecified best-effort behavior, so we only want to consider this test on an evaluator that satisfies some basic assumptions about this function.
6 assert builtins.unsafeGetAttrPos "a" { a = true; } != null;
8 builtins.unsafeGetAttrPos "a" (discardPositions {
14 options.imported.line14 = lib.mkOption {
18 # Simulates various patterns of generating modules such as
19 # programs.firefox.nativeMessagingHosts.ff2mpv. We don't expect to get
20 # line numbers for these, but we can fall back on knowing the file.
21 options.generated = discardPositions {
22 line22 = lib.mkOption {
27 options.submoduleLine38.extraOptLine27 = lib.mkOption {
34 options.nested.nestedLine34 = lib.mkOption {
38 options.submoduleLine38 = lib.mkOption {
40 type = lib.types.submoduleWith {
45 options.submodDeclLine45 = lib.mkOption { };
48 { freeformType = with lib.types; lazyAttrsOf (uniq unspecified); }
54 submoduleLine38.submodDeclLine45 =
55 (options.submoduleLine38.type.getSubOptions [ ]).submodDeclLine45.declarationPositions;