mpvScripts: handle nested attrsets (#359625)

This commit is contained in:
nicoo 2024-11-28 12:35:38 +00:00 committed by GitHub
parent cee3b71531
commit 595e00cbca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,11 +9,13 @@ let
unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint { };
addTests =
name: drv:
attrPath: drv:
if !lib.isDerivation drv then
drv
else
let
name = lib.concatStringsSep "." attrPath;
inherit (drv) scriptName;
scriptPath = "share/mpv/scripts/${scriptName}";
fullScriptPath = "${drv}/${scriptPath}";
@ -34,7 +36,7 @@ let
if [ -e "${fullScriptPath}" ]; then
touch $out
else
echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2
echo "mpvScripts.${name} does not contain a script named \"${scriptName}\"" >&2
exit 1
fi
'';
@ -83,62 +85,64 @@ let
let
inherit (self) callPackage;
in
lib.mapAttrs addTests {
inherit (callPackage ./mpv.nix { })
acompressor
autocrop
autodeint
autoload
;
inherit (callPackage ./occivink.nix { })
blacklistExtensions
crop
encode
seekTo
;
lib.mapAttrsRecursiveCond (x: x.recurseForDerivations or false) addTests (
lib.recurseIntoAttrs {
inherit (callPackage ./mpv.nix { })
acompressor
autocrop
autodeint
autoload
;
inherit (callPackage ./occivink.nix { })
blacklistExtensions
crop
encode
seekTo
;
buildLua = callPackage ./buildLua.nix { };
autosub = callPackage ./autosub.nix { };
autosubsync-mpv = callPackage ./autosubsync-mpv.nix { };
chapterskip = callPackage ./chapterskip.nix { };
convert = callPackage ./convert.nix { };
cutter = callPackage ./cutter.nix { };
dynamic-crop = callPackage ./dynamic-crop.nix { };
evafast = callPackage ./evafast.nix { };
inhibit-gnome = callPackage ./inhibit-gnome.nix { };
memo = callPackage ./memo.nix { };
manga-reader = callPackage ./manga-reader.nix { };
modernx = callPackage ./modernx.nix { };
modernx-zydezu = callPackage ./modernx-zydezu.nix { };
mpris = callPackage ./mpris.nix { };
mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
mpv-discord = callPackage ./mpv-discord.nix { };
mpv-notify-send = callPackage ./mpv-notify-send.nix { };
mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
mpv-osc-tethys = callPackage ./mpv-osc-tethys.nix { };
mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
mpv-slicing = callPackage ./mpv-slicing.nix { };
mpv-subtitle-lines = callPackage ./mpv-subtitle-lines.nix { };
mpv-webm = callPackage ./mpv-webm.nix { };
mpvacious = callPackage ./mpvacious.nix { };
quack = callPackage ./quack.nix { };
quality-menu = callPackage ./quality-menu.nix { };
reload = callPackage ./reload.nix { };
simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
smart-copy-paste-2 = callPackage ./smart-copy-paste-2.nix { };
smartskip = callPackage ./smartskip.nix { };
sponsorblock = callPackage ./sponsorblock.nix { };
sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
thumbfast = callPackage ./thumbfast.nix { };
thumbnail = callPackage ./thumbnail.nix { };
uosc = callPackage ./uosc.nix { };
videoclip = callPackage ./videoclip.nix { };
visualizer = callPackage ./visualizer.nix { };
vr-reversal = callPackage ./vr-reversal.nix { };
webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
youtube-chat = callPackage ./youtube-chat.nix { };
youtube-upnext = callPackage ./youtube-upnext.nix { };
};
buildLua = callPackage ./buildLua.nix { };
autosub = callPackage ./autosub.nix { };
autosubsync-mpv = callPackage ./autosubsync-mpv.nix { };
chapterskip = callPackage ./chapterskip.nix { };
convert = callPackage ./convert.nix { };
cutter = callPackage ./cutter.nix { };
dynamic-crop = callPackage ./dynamic-crop.nix { };
evafast = callPackage ./evafast.nix { };
inhibit-gnome = callPackage ./inhibit-gnome.nix { };
memo = callPackage ./memo.nix { };
manga-reader = callPackage ./manga-reader.nix { };
modernx = callPackage ./modernx.nix { };
modernx-zydezu = callPackage ./modernx-zydezu.nix { };
mpris = callPackage ./mpris.nix { };
mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
mpv-discord = callPackage ./mpv-discord.nix { };
mpv-notify-send = callPackage ./mpv-notify-send.nix { };
mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
mpv-osc-tethys = callPackage ./mpv-osc-tethys.nix { };
mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
mpv-slicing = callPackage ./mpv-slicing.nix { };
mpv-subtitle-lines = callPackage ./mpv-subtitle-lines.nix { };
mpv-webm = callPackage ./mpv-webm.nix { };
mpvacious = callPackage ./mpvacious.nix { };
quack = callPackage ./quack.nix { };
quality-menu = callPackage ./quality-menu.nix { };
reload = callPackage ./reload.nix { };
simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
smart-copy-paste-2 = callPackage ./smart-copy-paste-2.nix { };
smartskip = callPackage ./smartskip.nix { };
sponsorblock = callPackage ./sponsorblock.nix { };
sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
thumbfast = callPackage ./thumbfast.nix { };
thumbnail = callPackage ./thumbnail.nix { };
uosc = callPackage ./uosc.nix { };
videoclip = callPackage ./videoclip.nix { };
visualizer = callPackage ./visualizer.nix { };
vr-reversal = callPackage ./vr-reversal.nix { };
webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
youtube-chat = callPackage ./youtube-chat.nix { };
youtube-upnext = callPackage ./youtube-upnext.nix { };
}
);
aliases = {
youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
@ -152,5 +156,4 @@ lib.pipe scope [
assert builtins.intersectAttrs self aliases == { };
self // lib.optionalAttrs config.allowAliases aliases
)
lib.recurseIntoAttrs
]