diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix new file mode 100644 index 000000000000..1a2bb9260840 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -0,0 +1,30 @@ +{ lib +, callPackage +, config +}: + +lib.recurseIntoAttrs + ({ + acompressor = callPackage ./acompressor.nix { }; + autocrop = callPackage ./autocrop.nix { }; + autodeint = callPackage ./autodeint.nix { }; + autoload = callPackage ./autoload.nix { }; + convert = callPackage ./convert.nix { }; + inhibit-gnome = callPackage ./inhibit-gnome.nix { }; + mpris = callPackage ./mpris.nix { }; + mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; + mpvacious = callPackage ./mpvacious.nix { }; + quality-menu = callPackage ./quality-menu.nix { }; + simple-mpv-webui = callPackage ./simple-mpv-webui.nix { }; + sponsorblock = callPackage ./sponsorblock.nix { }; + thumbfast = callPackage ./thumbfast.nix { }; + thumbnail = callPackage ./thumbnail.nix { }; + uosc = callPackage ./uosc.nix { }; + vr-reversal = callPackage ./vr-reversal.nix { }; + webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { }; + cutter = callPackage ./cutter.nix { }; + } + // (callPackage ./occivink.nix { })) + // lib.optionalAttrs config.allowAliases { + youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14 +} diff --git a/pkgs/applications/video/mpv/scripts/quality-menu.nix b/pkgs/applications/video/mpv/scripts/quality-menu.nix new file mode 100644 index 000000000000..45d358843b37 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/quality-menu.nix @@ -0,0 +1,38 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, oscSupport ? false +}: + +stdenvNoCC.mkDerivation rec { + pname = "mpv-quality-menu"; + version = "4.1.0"; + + src = fetchFromGitHub { + owner = "christoph-heinrich"; + repo = "mpv-quality-menu"; + rev = "v${version}"; + hash = "sha256-93WoTeX61xzbjx/tgBgUVuwyR9MkAUzCfVSrbAC7Ddc="; + }; + + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/mpv/scripts + cp quality-menu.lua $out/share/mpv/scripts + '' + lib.optionalString oscSupport '' + cp quality-menu-osc.lua $out/share/mpv/scripts + '' + '' + runHook postInstall + ''; + + passthru.scriptName = "quality-menu.lua"; + + meta = with lib; { + description = "A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly"; + homepage = "https://github.com/christoph-heinrich/mpv-quality-menu"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ lunik1 ]; + }; +} diff --git a/pkgs/applications/video/mpv/scripts/youtube-quality.nix b/pkgs/applications/video/mpv/scripts/youtube-quality.nix deleted file mode 100644 index 5301e4232a06..000000000000 --- a/pkgs/applications/video/mpv/scripts/youtube-quality.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ lib -, stdenvNoCC -, fetchFromGitHub -, oscSupport ? false -}: - -stdenvNoCC.mkDerivation rec { - pname = "mpv-youtube-quality"; - version = "unstable-2020-02-11"; - - src = fetchFromGitHub { - owner = "jgreco"; - repo = "mpv-youtube-quality"; - rev = "1f8c31457459ffc28cd1c3f3c2235a53efad7148"; - sha256 = "voNP8tCwCv8QnAZOPC9gqHRV/7jgCAE63VKBd/1s5ic="; - }; - - dontBuild = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/mpv/scripts - cp youtube-quality.lua $out/share/mpv/scripts - '' + lib.optionalString oscSupport '' - cp youtube-quality-osc.lua $out/share/mpv/scripts - '' + '' - runHook postInstall - ''; - - passthru.scriptName = "youtube-quality.lua"; - - meta = with lib; { - description = "A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly"; - homepage = "https://github.com/jgreco/mpv-youtube-quality"; - license = licenses.unfree; - platforms = platforms.all; - maintainers = with maintainers; [ lunik1 ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 934e95404a2c..c50e576b3702 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33345,26 +33345,7 @@ with pkgs; mpvpaper = callPackage ../tools/wayland/mpvpaper { }; - mpvScripts = recurseIntoAttrs ({ - acompressor = callPackage ../applications/video/mpv/scripts/acompressor.nix {}; - autocrop = callPackage ../applications/video/mpv/scripts/autocrop.nix { }; - autodeint = callPackage ../applications/video/mpv/scripts/autodeint.nix { }; - autoload = callPackage ../applications/video/mpv/scripts/autoload.nix { }; - convert = callPackage ../applications/video/mpv/scripts/convert.nix { }; - inhibit-gnome = callPackage ../applications/video/mpv/scripts/inhibit-gnome.nix { }; - mpris = callPackage ../applications/video/mpv/scripts/mpris.nix { }; - mpv-playlistmanager = callPackage ../applications/video/mpv/scripts/mpv-playlistmanager.nix { }; - mpvacious = callPackage ../applications/video/mpv/scripts/mpvacious.nix { }; - simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix { }; - sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix { }; - thumbfast = callPackage ../applications/video/mpv/scripts/thumbfast.nix { }; - thumbnail = callPackage ../applications/video/mpv/scripts/thumbnail.nix { }; - uosc = callPackage ../applications/video/mpv/scripts/uosc.nix { }; - vr-reversal = callPackage ../applications/video/mpv/scripts/vr-reversal.nix { }; - webtorrent-mpv-hook = callPackage ../applications/video/mpv/scripts/webtorrent-mpv-hook.nix { }; - youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { }; - cutter = callPackage ../applications/video/mpv/scripts/cutter.nix { }; - } // (callPackage ../applications/video/mpv/scripts/occivink.nix {})); + mpvScripts = import ../applications/video/mpv/scripts { inherit lib callPackage config; }; open-in-mpv = callPackage ../applications/video/open-in-mpv { };