mpvScripts.buildLua: Expose meta.position

Undocumented in the nixpkgs manual, but apparently needed for `common-updaters`
and related tools such as `nix-update`.
This commit is contained in:
nicoo 2023-12-09 18:40:56 +00:00
parent eab72db9b0
commit b3b5d76be3

View File

@ -56,6 +56,17 @@ lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
'';
passthru = { inherit scriptName; };
meta.platforms = lib.platforms.all;
meta = {
platforms = lib.platforms.all;
} // (
let pos =
if (args.meta or {}) ? description then
builtins.unsafeGetAttrPos "description" args.meta
else
builtins.unsafeGetAttrPos "pname" args;
in lib.optionalAttrs
(pos != null)
{ position = "${pos.file}:${toString pos.line}"; }
);
})
))