diff options
author | nicoo <nicoo@mur.at> | 2023-12-09 18:40:56 +0000 |
---|---|---|
committer | nicoo <nicoo@mur.at> | 2023-12-12 18:59:19 +0000 |
commit | b3b5d76be332d79c1b077a3b25cbdf9661daee37 (patch) | |
tree | 14ebe1c26701dc0e48a38b2cebebe5662dada44a /pkgs/applications/video/mpv | |
parent | eab72db9b0cac0265d0dc4ac79f5511887ab1495 (diff) | |
download | nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar.gz nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar.bz2 nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar.lz nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar.xz nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.tar.zst nixlib-b3b5d76be332d79c1b077a3b25cbdf9661daee37.zip |
mpvScripts.buildLua: Expose `meta.position`
Undocumented in the nixpkgs manual, but apparently needed for `common-updaters` and related tools such as `nix-update`.
Diffstat (limited to 'pkgs/applications/video/mpv')
-rw-r--r-- | pkgs/applications/video/mpv/scripts/buildLua.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix index 4c1e1957c097..c92cdc96f29f 100644 --- a/pkgs/applications/video/mpv/scripts/buildLua.nix +++ b/pkgs/applications/video/mpv/scripts/buildLua.nix @@ -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}"; } + ); }) )) |