8 unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint {};
11 if ! lib.isDerivation drv then
14 inherit (drv) scriptName;
15 scriptPath = "share/mpv/scripts/${scriptName}";
16 fullScriptPath = "${drv}/${scriptPath}";
17 in drv.overrideAttrs (old: { passthru = (old.passthru or {}) // { tests = unionOfDisjoints [
18 (old.passthru.tests or {})
21 scriptName-is-valid = runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid" {
22 meta.maintainers = with lib.maintainers; [ nicoo ];
23 preferLocalBuild = true;
25 if [ -e "${fullScriptPath}" ]; then
28 echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2
34 # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode
35 (with lib; optionalAttrs (! any (s: hasSuffix s drv.passthru.scriptName) [ ".js" ".lua" ".so" ]) {
36 single-main-in-script-dir = runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" {
37 meta.maintainers = with lib.maintainers; [ nicoo ];
38 preferLocalBuild = true;
45 cd "${drv}/${scriptPath}" # so the glob expands to filenames only
47 if [ "''${#mains[*]}" -eq 1 ]; then
49 elif [ "''${#mains[*]}" -eq 0 ]; then
50 die "'${scriptPath}' contains no 'main.*' file"
52 die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}"
59 inherit (self) callPackage;
60 in lib.mapAttrs addTests {
61 inherit (callPackage ./mpv.nix { })
62 acompressor autocrop autodeint autoload;
63 inherit (callPackage ./occivink.nix { })
64 blacklistExtensions seekTo;
66 buildLua = callPackage ./buildLua.nix { };
67 chapterskip = callPackage ./chapterskip.nix { };
68 convert = callPackage ./convert.nix { };
69 cutter = callPackage ./cutter.nix { };
70 dynamic-crop = callPackage ./dynamic-crop.nix { };
71 inhibit-gnome = callPackage ./inhibit-gnome.nix { };
72 modernx = callPackage ./modernx.nix { };
73 modernx-zydezu = callPackage ./modernx-zydezu.nix { };
74 mpris = callPackage ./mpris.nix { };
75 mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
76 mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
77 mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
78 mpv-webm = callPackage ./mpv-webm.nix { };
79 mpvacious = callPackage ./mpvacious.nix { };
80 quack = callPackage ./quack.nix { };
81 quality-menu = callPackage ./quality-menu.nix { };
82 reload = callPackage ./reload.nix { };
83 simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
84 sponsorblock = callPackage ./sponsorblock.nix { };
85 sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
86 thumbfast = callPackage ./thumbfast.nix { };
87 thumbnail = callPackage ./thumbnail.nix { };
88 uosc = callPackage ./uosc.nix { };
89 visualizer = callPackage ./visualizer.nix { };
90 vr-reversal = callPackage ./vr-reversal.nix { };
91 webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
95 youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
99 with lib; pipe scope [
102 assert builtins.intersectAttrs self aliases == {};
103 self // optionalAttrs config.allowAliases aliases)