lib/introspection: backwards support older nixpkgs version with reduced features

This commit is contained in:
Johannes Kirschbauer
2025-10-02 17:38:46 +02:00
parent 13c2581cbd
commit 149e14e85d
2 changed files with 112 additions and 1 deletions

View File

@@ -164,7 +164,20 @@ let
else
getPrios { options = opt; }
) filteredOptions;
getPriosLegacy = import ./getPriosLegacy.nix { inherit lib; };
wrap =
{
options,
}:
# Test _module.check for valueMeta
# This option should always exist if options comes from a module evaluation
if options._module.check ? valueMeta then
getPrios { inherit options; }
else
getPriosLegacy { inherit options; };
in
{
inherit getPrios;
getPrios = wrap;
}