From e2596ac22d4211b3c070f9e518d7b4dc087edc9b Mon Sep 17 00:00:00 2001 From: nicoo Date: Sun, 9 Mar 2025 16:36:19 +0000 Subject: [PATCH] mpvScripts.buildLua: add a `runtime-dependencies` option --- .../video/mpv/scripts/buildLua.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix index 6d6831c1621b..822950ffc9b7 100644 --- a/pkgs/applications/video/mpv/scripts/buildLua.nix +++ b/pkgs/applications/video/mpv/scripts/buildLua.nix @@ -24,6 +24,7 @@ lib.makeOverridable ( { pname, extraScripts ? [ ], + runtime-dependencies ? [ ], ... }@args: let @@ -75,9 +76,20 @@ lib.makeOverridable ( runHook postInstall ''; - passthru = { - inherit scriptName; - }; + passthru = + { + inherit scriptName; + } + // lib.optionalAttrs (runtime-dependencies != [ ]) { + extraWrapperArgs = + [ + "--prefix" + "PATH" + ":" + ] + ++ (map lib.makeBinPath runtime-dependencies) + ++ args.passthru.extraWrapperArgs or [ ]; + }; meta = { platforms = lib.platforms.all;