mpvScripts: format according to RFC166 rules

nicoo a6f88138 294953dd

+530 -371
+81 -66
pkgs/applications/video/mpv/scripts/buildLua.nix
··· 1 - { lib 2 - , stdenvNoCC }: 1 + { lib, stdenvNoCC }: 3 2 4 3 let 5 4 # Escape strings for embedding in shell scripts ··· 10 9 scriptsDir = "$out/share/mpv/scripts"; 11 10 12 11 # similar to `lib.extends`, but with inverted precedence and recursive update 13 - extendedBy = args: orig: self: 14 - let super = args self; 15 - in lib.recursiveUpdate (orig super) super 16 - ; 12 + extendedBy = 13 + args: orig: self: 14 + let 15 + super = args self; 16 + in 17 + lib.recursiveUpdate (orig super) super; 17 18 in 18 19 19 - lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy 20 - (if lib.isFunction args then args else (_: args)) ( 21 - { pname 22 - , extraScripts ? [] 23 - , ... }@args: 24 - let 25 - strippedName = with builtins; 26 - let groups = match "mpv[-_](.*)" pname; in 27 - if groups != null 28 - then head groups 29 - else pname 30 - ; 31 - # either passthru.scriptName, inferred from scriptPath, or from pname 32 - scriptName = (args.passthru or {}).scriptName or ( 33 - if args ? scriptPath 34 - then fileName args.scriptPath 35 - else "${strippedName}.lua" 36 - ); 37 - scriptPath = args.scriptPath or "./${scriptName}"; 38 - in { 39 - dontBuild = true; 40 - preferLocalBuild = true; 20 + lib.makeOverridable ( 21 + args: 22 + stdenvNoCC.mkDerivation ( 23 + extendedBy (if lib.isFunction args then args else (_: args)) ( 24 + { 25 + pname, 26 + extraScripts ? [ ], 27 + ... 28 + }@args: 29 + let 30 + strippedName = 31 + with builtins; 32 + let 33 + groups = match "mpv[-_](.*)" pname; 34 + in 35 + if groups != null then head groups else pname; 36 + # either passthru.scriptName, inferred from scriptPath, or from pname 37 + scriptName = 38 + (args.passthru or { }).scriptName 39 + or (if args ? scriptPath then fileName args.scriptPath else "${strippedName}.lua"); 40 + scriptPath = args.scriptPath or "./${scriptName}"; 41 + in 42 + { 43 + dontBuild = true; 44 + preferLocalBuild = true; 41 45 42 - # Prevent `patch` from emitting `.orig` files (that end up in the output) 43 - patchFlags = [ "--no-backup-if-mismatch" "-p1" ]; 46 + # Prevent `patch` from emitting `.orig` files (that end up in the output) 47 + patchFlags = [ 48 + "--no-backup-if-mismatch" 49 + "-p1" 50 + ]; 44 51 45 - outputHashMode = "recursive"; 46 - installPhase = '' 47 - runHook preInstall 52 + outputHashMode = "recursive"; 53 + installPhase = '' 54 + runHook preInstall 48 55 49 - if [ -d "${scriptPath}" ]; then 50 - [ -f "${scriptPath}/main.lua" ] || { 51 - echo "Script directory '${scriptPath}' does not contain 'main.lua'" >&2 52 - exit 1 53 - } 54 - [ ${with builtins; toString (length extraScripts)} -eq 0 ] || { 55 - echo "mpvScripts.buildLua does not support 'extraScripts'" \ 56 - "when 'scriptPath' is a directory" >&2 57 - exit 1 58 - } 59 - mkdir -p "${scriptsDir}" 60 - cp -a "${scriptPath}" "${scriptsDir}/${scriptName}" 61 - else 62 - install -m644 -Dt "${scriptsDir}" ${escaped scriptPath} 63 - ${lib.optionalString (extraScripts != []) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}''} 64 - fi 56 + if [ -d "${scriptPath}" ]; then 57 + [ -f "${scriptPath}/main.lua" ] || { 58 + echo "Script directory '${scriptPath}' does not contain 'main.lua'" >&2 59 + exit 1 60 + } 61 + [ ${with builtins; toString (length extraScripts)} -eq 0 ] || { 62 + echo "mpvScripts.buildLua does not support 'extraScripts'" \ 63 + "when 'scriptPath' is a directory" >&2 64 + exit 1 65 + } 66 + mkdir -p "${scriptsDir}" 67 + cp -a "${scriptPath}" "${scriptsDir}/${scriptName}" 68 + else 69 + install -m644 -Dt "${scriptsDir}" ${escaped scriptPath} 70 + ${ 71 + lib.optionalString (extraScripts != [ ]) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}'' 72 + } 73 + fi 65 74 66 - runHook postInstall 67 - ''; 75 + runHook postInstall 76 + ''; 68 77 69 - passthru = { inherit scriptName; }; 70 - meta = { 71 - platforms = lib.platforms.all; 72 - } // ( 73 - let pos = 74 - if (args.meta or {}) ? description then 75 - builtins.unsafeGetAttrPos "description" args.meta 76 - else 77 - builtins.unsafeGetAttrPos "pname" args; 78 - in lib.optionalAttrs 79 - (pos != null) 80 - { position = "${pos.file}:${toString pos.line}"; } 81 - ); 82 - }) 83 - )) 78 + passthru = { 79 + inherit scriptName; 80 + }; 81 + meta = 82 + { 83 + platforms = lib.platforms.all; 84 + } 85 + // ( 86 + let 87 + pos = 88 + if (args.meta or { }) ? description then 89 + builtins.unsafeGetAttrPos "description" args.meta 90 + else 91 + builtins.unsafeGetAttrPos "pname" args; 92 + in 93 + lib.optionalAttrs (pos != null) { position = "${pos.file}:${toString pos.line}"; } 94 + ); 95 + } 96 + ) 97 + ) 98 + )
+13 -11
pkgs/applications/video/mpv/scripts/chapterskip.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , unstableGitUpdater 4 - , buildLua }: 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 6 + }: 5 7 6 8 buildLua { 7 9 pname = "chapterskip"; ··· 9 11 version = "0-unstable-2022-09-08"; 10 12 src = fetchFromGitHub { 11 13 owner = "po5"; 12 - repo = "chapterskip"; 13 - rev = "b26825316e3329882206ae78dc903ebc4613f039"; 14 - hash = "sha256-OTrLQE3rYvPQamEX23D6HttNjx3vafWdTMxTiWpDy90="; 14 + repo = "chapterskip"; 15 + rev = "b26825316e3329882206ae78dc903ebc4613f039"; 16 + hash = "sha256-OTrLQE3rYvPQamEX23D6HttNjx3vafWdTMxTiWpDy90="; 15 17 }; 16 - passthru.updateScript = unstableGitUpdater {}; 18 + passthru.updateScript = unstableGitUpdater { }; 17 19 18 20 meta = { 19 21 description = "Automatically skips chapters based on title"; 20 22 longDescription = '' 21 - MPV script that skips chapters based on their title, categorized using regexes. 22 - The set of skipped categories can be configured globally, or by an auto-profile. 23 + MPV script that skips chapters based on their title, categorized using regexes. 24 + The set of skipped categories can be configured globally, or by an auto-profile. 23 25 ''; 24 26 homepage = "https://github.com/po5/chapterskip"; 25 - license = lib.licenses.unfree; # https://github.com/po5/chapterskip/issues/10 27 + license = lib.licenses.unfree; # https://github.com/po5/chapterskip/issues/10 26 28 maintainers = with lib.maintainers; [ nicoo ]; 27 29 }; 28 30 }
+9 -8
pkgs/applications/video/mpv/scripts/convert.nix
··· 1 - { lib 2 - , fetchgit 3 - , unstableGitUpdater 1 + { 2 + lib, 3 + fetchgit, 4 + unstableGitUpdater, 4 5 5 - , buildLua 6 - , libnotify 7 - , mkvtoolnix-cli 8 - , yad 6 + buildLua, 7 + libnotify, 8 + mkvtoolnix-cli, 9 + yad, 9 10 }: 10 11 11 12 buildLua { ··· 16 17 rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d"; 17 18 sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck"; 18 19 }; 19 - passthru.updateScript = unstableGitUpdater {}; 20 + passthru.updateScript = unstableGitUpdater { }; 20 21 21 22 patches = [ ./convert.patch ]; 22 23
+8 -2
pkgs/applications/video/mpv/scripts/cutter.nix
··· 1 - { lib, buildLua, fetchFromGitHub, makeWrapper, unstableGitUpdater }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + makeWrapper, 6 + unstableGitUpdater, 7 + }: 2 8 3 9 buildLua { 4 10 pname = "video-cutter"; ··· 10 16 rev = "01a0396c075d5f8bbd1de5b571e6231f8899ab65"; 11 17 sha256 = "sha256-veoRFzUCRH8TrvR7x+WWoycpDyxqrJZ/bnp61dVc0pE="; 12 18 }; 13 - passthru.updateScript = unstableGitUpdater {}; 19 + passthru.updateScript = unstableGitUpdater { }; 14 20 15 21 nativeBuildInputs = [ makeWrapper ]; 16 22
+126 -92
pkgs/applications/video/mpv/scripts/default.nix
··· 1 - { lib 2 - , config 3 - , newScope 4 - , runCommand 1 + { 2 + lib, 3 + config, 4 + newScope, 5 + runCommand, 5 6 }: 6 7 7 8 let 8 - unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint {}; 9 + unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint { }; 9 10 10 - addTests = name: drv: 11 - if ! lib.isDerivation drv then 11 + addTests = 12 + name: drv: 13 + if !lib.isDerivation drv then 12 14 drv 13 - else let 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 {}) 15 + else 16 + let 17 + inherit (drv) scriptName; 18 + scriptPath = "share/mpv/scripts/${scriptName}"; 19 + fullScriptPath = "${drv}/${scriptPath}"; 20 + in 21 + drv.overrideAttrs (old: { 22 + passthru = (old.passthru or { }) // { 23 + tests = unionOfDisjoints [ 24 + (old.passthru.tests or { }) 19 25 20 - { 21 - scriptName-is-valid = runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid" { 22 - meta.maintainers = with lib.maintainers; [ nicoo ]; 23 - preferLocalBuild = true; 24 - } '' 25 - if [ -e "${fullScriptPath}" ]; then 26 - touch $out 27 - else 28 - echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2 29 - exit 1 30 - fi 31 - ''; 32 - } 26 + { 27 + scriptName-is-valid = 28 + runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid" 29 + { 30 + meta.maintainers = with lib.maintainers; [ nicoo ]; 31 + preferLocalBuild = true; 32 + } 33 + '' 34 + if [ -e "${fullScriptPath}" ]; then 35 + touch $out 36 + else 37 + echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2 38 + exit 1 39 + fi 40 + ''; 41 + } 33 42 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; 39 - } '' 40 - die() { 41 - echo "$@" >&2 42 - exit 1 43 - } 43 + # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode 44 + ( 45 + with lib; 46 + optionalAttrs 47 + ( 48 + !any (s: hasSuffix s drv.passthru.scriptName) [ 49 + ".js" 50 + ".lua" 51 + ".so" 52 + ] 53 + ) 54 + { 55 + single-main-in-script-dir = 56 + runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" 57 + { 58 + meta.maintainers = with lib.maintainers; [ nicoo ]; 59 + preferLocalBuild = true; 60 + } 61 + '' 62 + die() { 63 + echo "$@" >&2 64 + exit 1 65 + } 44 66 45 - cd "${drv}/${scriptPath}" # so the glob expands to filenames only 46 - mains=( main.* ) 47 - if [ "''${#mains[*]}" -eq 1 ]; then 48 - touch $out 49 - elif [ "''${#mains[*]}" -eq 0 ]; then 50 - die "'${scriptPath}' contains no 'main.*' file" 51 - else 52 - die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}" 53 - fi 54 - ''; 55 - }) 56 - ]; }; }); 67 + cd "${drv}/${scriptPath}" # so the glob expands to filenames only 68 + mains=( main.* ) 69 + if [ "''${#mains[*]}" -eq 1 ]; then 70 + touch $out 71 + elif [ "''${#mains[*]}" -eq 0 ]; then 72 + die "'${scriptPath}' contains no 'main.*' file" 73 + else 74 + die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}" 75 + fi 76 + ''; 77 + } 78 + ) 79 + ]; 80 + }; 81 + }); 57 82 58 - scope = self: let 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; 83 + scope = 84 + self: 85 + let 86 + inherit (self) callPackage; 87 + in 88 + lib.mapAttrs addTests { 89 + inherit (callPackage ./mpv.nix { }) 90 + acompressor 91 + autocrop 92 + autodeint 93 + autoload 94 + ; 95 + inherit (callPackage ./occivink.nix { }) blacklistExtensions seekTo; 65 96 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 - memo = callPackage ./memo.nix { }; 73 - manga-reader = callPackage ./manga-reader.nix { }; 74 - modernx = callPackage ./modernx.nix { }; 75 - modernx-zydezu = callPackage ./modernx-zydezu.nix { }; 76 - mpris = callPackage ./mpris.nix { }; 77 - mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { }; 78 - mpv-notify-send = callPackage ./mpv-notify-send.nix { }; 79 - mpv-osc-modern = callPackage ./mpv-osc-modern.nix { }; 80 - mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; 81 - mpv-slicing = callPackage ./mpv-slicing.nix { }; 82 - mpv-webm = callPackage ./mpv-webm.nix { }; 83 - mpvacious = callPackage ./mpvacious.nix { }; 84 - quack = callPackage ./quack.nix { }; 85 - quality-menu = callPackage ./quality-menu.nix { }; 86 - reload = callPackage ./reload.nix { }; 87 - simple-mpv-webui = callPackage ./simple-mpv-webui.nix { }; 88 - sponsorblock = callPackage ./sponsorblock.nix { }; 89 - sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { }; 90 - thumbfast = callPackage ./thumbfast.nix { }; 91 - thumbnail = callPackage ./thumbnail.nix { }; 92 - uosc = callPackage ./uosc.nix { }; 93 - videoclip = callPackage ./videoclip.nix { }; 94 - visualizer = callPackage ./visualizer.nix { }; 95 - vr-reversal = callPackage ./vr-reversal.nix { }; 96 - webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { }; 97 - youtube-upnext = callPackage ./youtube-upnext.nix { }; 98 - }; 97 + buildLua = callPackage ./buildLua.nix { }; 98 + chapterskip = callPackage ./chapterskip.nix { }; 99 + convert = callPackage ./convert.nix { }; 100 + cutter = callPackage ./cutter.nix { }; 101 + dynamic-crop = callPackage ./dynamic-crop.nix { }; 102 + inhibit-gnome = callPackage ./inhibit-gnome.nix { }; 103 + memo = callPackage ./memo.nix { }; 104 + manga-reader = callPackage ./manga-reader.nix { }; 105 + modernx = callPackage ./modernx.nix { }; 106 + modernx-zydezu = callPackage ./modernx-zydezu.nix { }; 107 + mpris = callPackage ./mpris.nix { }; 108 + mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { }; 109 + mpv-notify-send = callPackage ./mpv-notify-send.nix { }; 110 + mpv-osc-modern = callPackage ./mpv-osc-modern.nix { }; 111 + mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; 112 + mpv-slicing = callPackage ./mpv-slicing.nix { }; 113 + mpv-webm = callPackage ./mpv-webm.nix { }; 114 + mpvacious = callPackage ./mpvacious.nix { }; 115 + quack = callPackage ./quack.nix { }; 116 + quality-menu = callPackage ./quality-menu.nix { }; 117 + reload = callPackage ./reload.nix { }; 118 + simple-mpv-webui = callPackage ./simple-mpv-webui.nix { }; 119 + sponsorblock = callPackage ./sponsorblock.nix { }; 120 + sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { }; 121 + thumbfast = callPackage ./thumbfast.nix { }; 122 + thumbnail = callPackage ./thumbnail.nix { }; 123 + uosc = callPackage ./uosc.nix { }; 124 + videoclip = callPackage ./videoclip.nix { }; 125 + visualizer = callPackage ./visualizer.nix { }; 126 + vr-reversal = callPackage ./vr-reversal.nix { }; 127 + webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { }; 128 + youtube-upnext = callPackage ./youtube-upnext.nix { }; 129 + }; 99 130 100 131 aliases = { 101 132 youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14 102 133 }; 103 134 in 104 135 105 - with lib; pipe scope [ 136 + with lib; 137 + pipe scope [ 106 138 (makeScope newScope) 107 - (self: 108 - assert builtins.intersectAttrs self aliases == {}; 109 - self // optionalAttrs config.allowAliases aliases) 139 + ( 140 + self: 141 + assert builtins.intersectAttrs self aliases == { }; 142 + self // optionalAttrs config.allowAliases aliases 143 + ) 110 144 recurseIntoAttrs 111 145 ]
+5 -4
pkgs/applications/video/mpv/scripts/dynamic-crop.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , unstableGitUpdater 4 - , buildLua 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 5 6 }: 6 7 buildLua { 7 8 pname = "dynamic-crop";
+14 -5
pkgs/applications/video/mpv/scripts/inhibit-gnome.nix
··· 1 - { lib, stdenv, fetchFromGitHub, gitUpdater, pkg-config, dbus, mpv-unwrapped }: 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + pkg-config, 7 + dbus, 8 + mpv-unwrapped, 9 + }: 2 10 3 11 stdenv.mkDerivation rec { 4 12 pname = "mpv-inhibit-gnome"; ··· 10 18 rev = "v${version}"; 11 19 hash = "sha256-LSGg5gAQE2JpepBqhz6D6d3NlqYaU4bjvYf1F+oLphQ="; 12 20 }; 13 - passthru.updateScript = gitUpdater { 14 - rev-prefix = "v"; 15 - }; 21 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 16 22 17 23 nativeBuildInputs = [ pkg-config ]; 18 24 19 - buildInputs = [ dbus mpv-unwrapped ]; 25 + buildInputs = [ 26 + dbus 27 + mpv-unwrapped 28 + ]; 20 29 21 30 passthru.scriptName = "mpv_inhibit_gnome.so"; 22 31
+6 -5
pkgs/applications/video/mpv/scripts/memo.nix
··· 1 - { fetchFromGitHub 2 - , buildLua 3 - , lib 4 - , unstableGitUpdater 1 + { 2 + fetchFromGitHub, 3 + buildLua, 4 + lib, 5 + unstableGitUpdater, 5 6 }: 6 7 7 8 buildLua { ··· 15 16 hash = "sha256-m8ikXuw7PM4Btg8w7ufLneKA4fnYjMyfVJYueZILMw8="; 16 17 }; 17 18 18 - passthru.updateScript = unstableGitUpdater {}; 19 + passthru.updateScript = unstableGitUpdater { }; 19 20 20 21 meta = with lib; { 21 22 description = "A recent files menu for mpv";
+6 -5
pkgs/applications/video/mpv/scripts/modernx-zydezu.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , makeFontsConf 5 - , nix-update-script 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + makeFontsConf, 6 + nix-update-script, 6 7 }: 7 8 buildLua (finalAttrs: { 8 9 pname = "modernx-zydezu";
+6 -5
pkgs/applications/video/mpv/scripts/modernx.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , makeFontsConf 5 - , nix-update-script 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + makeFontsConf, 6 + nix-update-script, 6 7 }: 7 8 buildLua (finalAttrs: { 8 9 pname = "modernx";
+16 -3
pkgs/applications/video/mpv/scripts/mpris.nix
··· 1 - { lib, stdenv, fetchFromGitHub, gitUpdater, pkg-config, glib, mpv-unwrapped, ffmpeg }: 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + pkg-config, 7 + glib, 8 + mpv-unwrapped, 9 + ffmpeg, 10 + }: 2 11 3 12 stdenv.mkDerivation rec { 4 13 pname = "mpv-mpris"; ··· 10 19 rev = version; 11 20 hash = "sha256-vZIO6ILatIWa9nJYOp4AMKwvaZLahqYWRLMDOizyBI0="; 12 21 }; 13 - passthru.updateScript = gitUpdater {}; 22 + passthru.updateScript = gitUpdater { }; 14 23 15 24 nativeBuildInputs = [ pkg-config ]; 16 25 17 - buildInputs = [ glib mpv-unwrapped ffmpeg ]; 26 + buildInputs = [ 27 + glib 28 + mpv-unwrapped 29 + ffmpeg 30 + ]; 18 31 19 32 postPatch = '' 20 33 substituteInPlace Makefile --replace-fail 'PKG_CONFIG =' 'PKG_CONFIG ?='
+7 -9
pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , gitUpdater 4 - , nodePackages 5 - , stdenvNoCC 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + gitUpdater, 5 + nodePackages, 6 + stdenvNoCC, 6 7 }: 7 8 stdenvNoCC.mkDerivation (finalAttrs: { 8 9 pname = "mpv-cheatsheet"; ··· 16 17 }; 17 18 passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 18 19 19 - nativeBuildInputs = [ 20 - nodePackages.browserify 21 - ]; 20 + nativeBuildInputs = [ nodePackages.browserify ]; 22 21 23 22 buildPhase = '' 24 23 runHook preBuild ··· 35 34 36 35 runHook postInstall 37 36 ''; 38 - 39 37 40 38 passthru.scriptName = "cheatsheet.js"; 41 39
+12 -7
pkgs/applications/video/mpv/scripts/mpv-notify-send.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , fetchpatch 5 - , unstableGitUpdater 6 - , libnotify }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + fetchpatch, 6 + unstableGitUpdater, 7 + libnotify, 8 + }: 7 9 8 10 buildLua rec { 9 11 pname = "mpv-notify-send"; ··· 25 27 ]; 26 28 27 29 passthru.extraWrapperArgs = [ 28 - "--prefix" "PATH" ":" (lib.makeBinPath libnotify) 30 + "--prefix" 31 + "PATH" 32 + ":" 33 + (lib.makeBinPath libnotify) 29 34 ]; 30 35 31 36 passthru.updateScript = unstableGitUpdater { };
+6 -5
pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , makeFontsConf 5 - , nix-update-script 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + makeFontsConf, 6 + nix-update-script, 6 7 }: 7 8 buildLua (finalAttrs: { 8 9 pname = "mpv-osc-modern";
+8 -2
pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
··· 1 - { lib, buildLua, fetchFromGitHub, unstableGitUpdater, yt-dlp }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + unstableGitUpdater, 6 + yt-dlp, 7 + }: 2 8 3 9 buildLua rec { 4 10 pname = "mpv-playlistmanager"; ··· 10 16 rev = "1911dc053951169c98cfcfd9f44ef87d9122ca80"; 11 17 hash = "sha256-pcdOMhkivLF5B86aNuHrqj77DuYLAFGlwFwY7jxkDkE="; 12 18 }; 13 - passthru.updateScript = unstableGitUpdater {}; 19 + passthru.updateScript = unstableGitUpdater { }; 14 20 15 21 postPatch = '' 16 22 substituteInPlace playlistmanager.lua \
+6 -5
pkgs/applications/video/mpv/scripts/mpv-webm.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , luaPackages 5 - , unstableGitUpdater 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + luaPackages, 6 + unstableGitUpdater, 6 7 }: 7 8 8 9 buildLua {
+24 -17
pkgs/applications/video/mpv/scripts/mpv.nix
··· 1 - { lib 2 - , buildLua 3 - , mpv-unwrapped 1 + { 2 + lib, 3 + buildLua, 4 + mpv-unwrapped, 4 5 }: 5 6 6 - let mkBuiltin = name: args: 7 - let srcPath = "TOOLS/lua/${name}.lua"; 8 - in buildLua (lib.attrsets.recursiveUpdate rec { 9 - inherit (mpv-unwrapped) src version; 10 - pname = "mpv-${name}"; 7 + let 8 + mkBuiltin = 9 + name: args: 10 + let 11 + srcPath = "TOOLS/lua/${name}.lua"; 12 + in 13 + buildLua ( 14 + lib.attrsets.recursiveUpdate rec { 15 + inherit (mpv-unwrapped) src version; 16 + pname = "mpv-${name}"; 11 17 12 - dontUnpack = true; 13 - scriptPath = "${src}/${srcPath}"; 14 - 15 - meta = with lib; { 16 - inherit (mpv-unwrapped.meta) license; 17 - homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}"; 18 - }; 19 - } args); 18 + dontUnpack = true; 19 + scriptPath = "${src}/${srcPath}"; 20 20 21 - in lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) { 21 + meta = with lib; { 22 + inherit (mpv-unwrapped.meta) license; 23 + homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}"; 24 + }; 25 + } args 26 + ); 27 + in 28 + lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) { 22 29 acompressor.meta = { 23 30 description = "Script to toggle and control ffmpeg's dynamic range compression filter."; 24 31 maintainers = with lib.maintainers; [ nicoo ];
+9 -10
pkgs/applications/video/mpv/scripts/mpvacious.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , gitUpdater 5 - , curl 6 - , wl-clipboard 7 - , xclip 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + curl, 7 + wl-clipboard, 8 + xclip, 8 9 }: 9 10 10 11 buildLua rec { ··· 17 18 rev = "v${version}"; 18 19 sha256 = "sha256-VHMXW2AzgX88EDnNshxo9Gh8mpXzRoTAq+58HKasUdo="; 19 20 }; 20 - passthru.updateScript = gitUpdater { 21 - rev-prefix = "v"; 22 - }; 21 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 23 22 24 23 postPatch = '' 25 24 substituteInPlace utils/forvo.lua \
+36 -32
pkgs/applications/video/mpv/scripts/occivink.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , unstableGitUpdater 4 - , buildLua 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 5 6 }: 6 7 7 8 let 8 - camelToKebab = let 9 - inherit (lib.strings) match stringAsChars toLower; 10 - isUpper = match "[A-Z]"; 11 - in stringAsChars (c: if isUpper c != null then "-${toLower c}" else c); 12 - 13 - mkScript = name: args: 14 - let self = rec { 15 - pname = camelToKebab name; 16 - version = "0-unstable-2024-01-11"; 17 - src = fetchFromGitHub { 18 - owner = "occivink"; 19 - repo = "mpv-scripts"; 20 - rev = "d0390c8e802c2e888ff4a2e1d5e4fb040f855b89"; 21 - hash = "sha256-pc2aaO7lZaoYMEXv5M0WI7PtmqgkNbdtNiLZZwVzppM="; 22 - }; 23 - passthru.updateScript = unstableGitUpdater {}; 9 + camelToKebab = 10 + let 11 + inherit (lib.strings) match stringAsChars toLower; 12 + isUpper = match "[A-Z]"; 13 + in 14 + stringAsChars (c: if isUpper c != null then "-${toLower c}" else c); 24 15 25 - scriptPath = "scripts/${pname}.lua"; 16 + mkScript = 17 + name: args: 18 + let 19 + self = rec { 20 + pname = camelToKebab name; 21 + version = "0-unstable-2024-01-11"; 22 + src = fetchFromGitHub { 23 + owner = "occivink"; 24 + repo = "mpv-scripts"; 25 + rev = "d0390c8e802c2e888ff4a2e1d5e4fb040f855b89"; 26 + hash = "sha256-pc2aaO7lZaoYMEXv5M0WI7PtmqgkNbdtNiLZZwVzppM="; 27 + }; 28 + passthru.updateScript = unstableGitUpdater { }; 26 29 27 - meta = with lib; { 28 - homepage = "https://github.com/occivink/mpv-scripts"; 29 - license = licenses.unlicense; 30 - maintainers = with maintainers; [ nicoo ]; 31 - }; 30 + scriptPath = "scripts/${pname}.lua"; 32 31 33 - # Sadly needed to make `common-updaters` work here 34 - pos = builtins.unsafeGetAttrPos "version" self; 35 - }; 36 - in buildLua (lib.attrsets.recursiveUpdate self args); 32 + meta = with lib; { 33 + homepage = "https://github.com/occivink/mpv-scripts"; 34 + license = licenses.unlicense; 35 + maintainers = with maintainers; [ nicoo ]; 36 + }; 37 37 38 + # Sadly needed to make `common-updaters` work here 39 + pos = builtins.unsafeGetAttrPos "version" self; 40 + }; 41 + in 42 + buildLua (lib.attrsets.recursiveUpdate self args); 38 43 in 39 44 lib.mapAttrs (name: lib.makeOverridable (mkScript name)) { 40 45 41 46 # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }` 42 47 seekTo.meta.description = "Mpv script for seeking to a specific position"; 43 - blacklistExtensions.meta.description = 44 - "Automatically remove playlist entries based on their extension."; 48 + blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension."; 45 49 }
+10 -8
pkgs/applications/video/mpv/scripts/quack.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , unstableGitUpdater 4 - , buildLua }: 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 6 + }: 5 7 6 8 buildLua rec { 7 9 pname = "mpv-quack"; ··· 9 11 version = "0-unstable-2020-05-27"; 10 12 src = fetchFromGitHub { 11 13 owner = "CounterPillow"; 12 - repo = "mpv-quack"; 13 - rev = "1c87f36f9726d462dd112188c04be54d85692cf3"; 14 - hash = "sha256-dEnJbS8RJoAxpKINdoMHN4l7vpEdf7+C5JVWpK0VXMw="; 14 + repo = "mpv-quack"; 15 + rev = "1c87f36f9726d462dd112188c04be54d85692cf3"; 16 + hash = "sha256-dEnJbS8RJoAxpKINdoMHN4l7vpEdf7+C5JVWpK0VXMw="; 15 17 }; 16 - passthru.updateScript = unstableGitUpdater {}; 18 + passthru.updateScript = unstableGitUpdater { }; 17 19 18 20 meta = { 19 21 description = "Reduce audio volume after seeking";
+7 -8
pkgs/applications/video/mpv/scripts/quality-menu.nix
··· 1 - { lib 2 - , buildLua 3 - , fetchFromGitHub 4 - , gitUpdater 5 - , oscSupport ? false 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + oscSupport ? false, 6 7 }: 7 8 8 9 buildLua rec { ··· 15 16 rev = "v${version}"; 16 17 hash = "sha256-yrcTxqpLnOI1Tq3khhflO3wzhyeTPuvKifyH5/P57Ns="; 17 18 }; 18 - passthru.updateScript = gitUpdater { 19 - rev-prefix = "v"; 20 - }; 19 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 21 20 22 21 extraScripts = lib.optional oscSupport "quality-menu-osc.lua"; 23 22
+10 -8
pkgs/applications/video/mpv/scripts/reload.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , unstableGitUpdater 4 - , buildLua }: 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 6 + }: 5 7 6 8 buildLua rec { 7 9 pname = "mpv-reload"; ··· 9 11 version = "0-unstable-2024-03-22"; 10 12 src = fetchFromGitHub { 11 13 owner = "4e6"; 12 - repo = pname; 13 - rev = "1a6a9383ba1774708fddbd976e7a9b72c3eec938"; 14 - hash = "sha256-BshxCjec/UNGyiC0/g1Rai2NvG2qOIHXDDEUYwwdij0="; 14 + repo = pname; 15 + rev = "1a6a9383ba1774708fddbd976e7a9b72c3eec938"; 16 + hash = "sha256-BshxCjec/UNGyiC0/g1Rai2NvG2qOIHXDDEUYwwdij0="; 15 17 }; 16 - passthru.updateScript = unstableGitUpdater {}; 18 + passthru.updateScript = unstableGitUpdater { }; 17 19 18 20 meta = { 19 21 description = "Manual & automatic reloading of videos";
+14 -8
pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
··· 1 - { lib, buildLua 2 - , fetchFromGitHub 3 - , gitUpdater 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + gitUpdater, 4 6 }: 5 7 buildLua rec { 6 8 pname = "simple-mpv-ui"; ··· 11 13 repo = "simple-mpv-webui"; 12 14 rev = "v${version}"; 13 15 hash = "sha256-I8lwpo3Hfpy3UnPMmHEJCdArVQnNL245NkxsYVmnMF0="; 14 - sparseCheckout = [ "main.lua" "webui-page" ]; 15 - }; 16 - passthru.updateScript = gitUpdater { 17 - rev-prefix = "v"; 16 + sparseCheckout = [ 17 + "main.lua" 18 + "webui-page" 19 + ]; 18 20 }; 21 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 19 22 20 23 scriptPath = "."; 21 24 passthru.scriptName = "webui"; ··· 23 26 meta = with lib; { 24 27 description = "A web based user interface with controls for the mpv mediaplayer"; 25 28 homepage = "https://github.com/open-dynaMIX/simple-mpv-webui"; 26 - maintainers = with maintainers; [ cript0nauta zopieux ]; 29 + maintainers = with maintainers; [ 30 + cript0nauta 31 + zopieux 32 + ]; 27 33 longDescription = '' 28 34 You can access the webui when accessing http://127.0.0.1:8080 or 29 35 http://[::1]:8080 in your webbrowser. By default it listens on
+9 -3
pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
··· 1 - { lib, buildLua, fetchFromGitea, unstableGitUpdater, curl, coreutils }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitea, 5 + unstableGitUpdater, 6 + curl, 7 + coreutils, 8 + }: 2 9 3 10 buildLua { 4 11 pname = "mpv_sponsorblock_minimal"; ··· 21 28 ''; 22 29 23 30 meta = with lib; { 24 - description = 25 - "A minimal script to skip sponsored segments of YouTube videos"; 31 + description = "A minimal script to skip sponsored segments of YouTube videos"; 26 32 homepage = "https://codeberg.org/jouni/mpv_sponsorblock_minimal"; 27 33 license = licenses.gpl3Only; 28 34 platforms = platforms.all;
+9 -4
pkgs/applications/video/mpv/scripts/sponsorblock.nix
··· 1 - { lib, buildLua, fetchFromGitHub, fetchpatch, python3, nix-update-script }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + fetchpatch, 6 + python3, 7 + nix-update-script, 8 + }: 2 9 3 10 # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }` 4 11 buildLua { ··· 34 41 35 42 extraScripts = [ "sponsorblock_shared" ]; 36 43 37 - passthru.updateScript = nix-update-script { 38 - extraArgs = [ "--version=branch" ]; 39 - }; 44 + passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; 40 45 41 46 meta = with lib; { 42 47 description = "Script for mpv to skip sponsored segments of YouTube videos";
+12 -3
pkgs/applications/video/mpv/scripts/thumbfast.nix
··· 1 - { lib, fetchFromGitHub, unstableGitUpdater, buildLua, mpv-unwrapped }: 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + unstableGitUpdater, 5 + buildLua, 6 + mpv-unwrapped, 7 + }: 2 8 3 9 buildLua { 4 10 pname = "mpv-thumbfast"; ··· 10 16 rev = "03e93feee5a85bf7c65db953ada41b4826e9f905"; 11 17 hash = "sha256-5u5WBvWOEydJrnr/vilEgW4+fxkxM6wNjb9Fyyxx/1c="; 12 18 }; 13 - passthru.updateScript = unstableGitUpdater {}; 19 + passthru.updateScript = unstableGitUpdater { }; 14 20 15 21 passthru.extraWrapperArgs = [ 16 - "--prefix" "PATH" ":" (lib.makeBinPath [ mpv-unwrapped ]) 22 + "--prefix" 23 + "PATH" 24 + ":" 25 + (lib.makeBinPath [ mpv-unwrapped ]) 17 26 ]; 18 27 19 28 meta = {
+8 -2
pkgs/applications/video/mpv/scripts/thumbnail.nix
··· 1 - { lib, buildLua, fetchFromGitHub, gitUpdater, python3 }: 1 + { 2 + lib, 3 + buildLua, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + python3, 7 + }: 2 8 3 9 buildLua rec { 4 10 pname = "mpv-thumbnail-script"; ··· 10 16 rev = version; 11 17 sha256 = "sha256-J24Rou7BTE7zoiPlBkWuO9dtYJiuzkuwB4FROuzXzag="; 12 18 }; 13 - passthru.updateScript = gitUpdater {}; 19 + passthru.updateScript = gitUpdater { }; 14 20 15 21 nativeBuildInputs = [ python3 ]; 16 22 postPatch = "patchShebangs concat_files.py";
+9 -8
pkgs/applications/video/mpv/scripts/uosc.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , fetchpatch 4 - , gitUpdater 5 - , makeFontsConf 6 - , buildLua 7 - , buildGoModule 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + fetchpatch, 5 + gitUpdater, 6 + makeFontsConf, 7 + buildLua, 8 + buildGoModule, 8 9 }: 9 10 10 11 buildLua (finalAttrs: { ··· 18 19 rev = finalAttrs.version; 19 20 hash = "sha256-0GPDna9uOuhFDhA9A1fbkoKkgSB76qiDzJVQ9gjGcWo="; 20 21 }; 21 - passthru.updateScript = gitUpdater {}; 22 + passthru.updateScript = gitUpdater { }; 22 23 23 24 tools = buildGoModule { 24 25 pname = "uosc-bin";
+18 -15
pkgs/applications/video/mpv/scripts/videoclip.nix
··· 1 - { lib 2 - , fetchFromGitHub 3 - , curl 4 - , xclip 5 - , wl-clipboard 6 - , stdenv 7 - , buildLua 8 - , unstableGitUpdater 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + curl, 5 + xclip, 6 + wl-clipboard, 7 + stdenv, 8 + buildLua, 9 + unstableGitUpdater, 9 10 }: 10 11 buildLua { 11 12 pname = "videoclip"; ··· 18 19 hash = "sha256-Sg6LHU9OVmVx3cTs8Y0WL8wACb5BlVyeBRccoX+7BXY="; 19 20 }; 20 21 21 - patchPhase = '' 22 - substituteInPlace platform.lua \ 23 - --replace \'curl\' \'${lib.getExe curl}\' \ 24 - '' + lib.optionalString stdenv.isLinux '' 25 - --replace xclip ${lib.getExe xclip} \ 26 - --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"} 27 - ''; 22 + patchPhase = 23 + '' 24 + substituteInPlace platform.lua \ 25 + --replace \'curl\' \'${lib.getExe curl}\' \ 26 + '' 27 + + lib.optionalString stdenv.isLinux '' 28 + --replace xclip ${lib.getExe xclip} \ 29 + --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"} 30 + ''; 28 31 29 32 scriptPath = "."; 30 33 passthru.scriptName = "videoclip";
+2 -2
pkgs/applications/video/mpv/scripts/visualizer.nix
··· 14 14 rev = "b4246984ba6dc6820adef5c8bbf793af85c9ab8e"; 15 15 sha256 = "ZNUzw4OW7z+yGTxim7CCWJdWmihDFOQAQk3bC5Ijcbs="; 16 16 }; 17 - passthru.updateScript = unstableGitUpdater {}; 17 + passthru.updateScript = unstableGitUpdater { }; 18 18 19 19 meta = with lib; { 20 20 description = "various audio visualization"; 21 21 homepage = "https://github.com/mfcc64/mpv-scripts"; 22 - maintainers = with maintainers; [kmein]; 22 + maintainers = with maintainers; [ kmein ]; 23 23 }; 24 24 }
+8 -4
pkgs/applications/video/mpv/scripts/vr-reversal.nix
··· 1 - { lib, stdenvNoCC, fetchFromGitHub, gitUpdater, ffmpeg }: 1 + { 2 + lib, 3 + stdenvNoCC, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + ffmpeg, 7 + }: 2 8 3 9 stdenvNoCC.mkDerivation rec { 4 10 pname = "vr-reversal"; ··· 10 16 rev = "v${version}"; 11 17 sha256 = "1wn2ngcvn7wcsl3kmj782x5q9130qw951lj6ilrkafp6q6zscpqr"; 12 18 }; 13 - passthru.updateScript = gitUpdater { 14 - rev-prefix = "v"; 15 - }; 19 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 16 20 17 21 dontBuild = true; 18 22
+9 -4
pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
··· 1 - { lib, buildNpmPackage, fetchFromGitHub, gitUpdater, nodejs, python3 }: 1 + { 2 + lib, 3 + buildNpmPackage, 4 + fetchFromGitHub, 5 + gitUpdater, 6 + nodejs, 7 + python3, 8 + }: 2 9 3 10 buildNpmPackage rec { 4 11 pname = "webtorrent-mpv-hook"; ··· 10 17 rev = "v${version}"; 11 18 hash = "sha256-/dMtXcIyfAs++Zgz2CxRW0tkzn5QjS+WVGChlCyrU0U="; 12 19 }; 13 - passthru.updateScript = gitUpdater { 14 - rev-prefix = "v"; 15 - }; 20 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 16 21 17 22 postPatch = '' 18 23 substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${lib.getExe nodejs}'"
+7 -1
pkgs/applications/video/mpv/scripts/youtube-upnext.nix
··· 1 - { buildLua, fetchFromGitHub, curl, unstableGitUpdater, lib }: 1 + { 2 + buildLua, 3 + fetchFromGitHub, 4 + curl, 5 + unstableGitUpdater, 6 + lib, 7 + }: 2 8 3 9 buildLua rec { 4 10 pname = "youtube-upnext";