diff options
author | nicoo <nicoo@mur.at> | 2023-11-11 22:16:40 +0000 |
---|---|---|
committer | nicoo <nicoo@mur.at> | 2023-11-11 22:43:48 +0000 |
commit | 9c2b07c6d70f6d7cd0980e5e691483917bf467d3 (patch) | |
tree | d6317ceae4d039b8cf0a181e2d2fbe20d32128e0 /pkgs/applications/video/mpv | |
parent | 588e73db432c2b6a1932033232733da0078a5251 (diff) | |
download | nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar.gz nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar.bz2 nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar.lz nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar.xz nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.tar.zst nixlib-9c2b07c6d70f6d7cd0980e5e691483917bf467d3.zip |
mpvScripts.buildLua: Infer `scriptName` from `scriptPath` over `pname`
Diffstat (limited to 'pkgs/applications/video/mpv')
-rw-r--r-- | pkgs/applications/video/mpv/scripts/buildLua.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix index f00b35254efe..769e11798a6a 100644 --- a/pkgs/applications/video/mpv/scripts/buildLua.nix +++ b/pkgs/applications/video/mpv/scripts/buildLua.nix @@ -8,10 +8,17 @@ let in lib.makeOverridable ( { pname - , scriptPath ? "${pname}.lua" , extraScripts ? [] , ... }@args: - + let + # either passthru.scriptName, inferred from scriptPath, or from pname + scriptName = (args.passthru or {}).scriptName or ( + if args ? scriptPath + then fileName args.scriptPath + else "${pname}.lua" + ); + scriptPath = args.scriptPath or "./${scriptName}"; + in stdenvNoCC.mkDerivation (lib.attrsets.recursiveUpdate { dontBuild = true; preferLocalBuild = true; @@ -24,7 +31,7 @@ lib.makeOverridable ( runHook postInstall ''; - passthru.scriptName = fileName scriptPath; + passthru = { inherit scriptName; }; meta.platforms = lib.platforms.all; } args) ) |