push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
{
lib,
buildLua,
fetchFromGitHub,
unstableGitUpdater,
python3Packages,
}:
buildLua {
pname = "mpv-autosub";
version = "0-unstable-2021-06-29";
scriptPath = "autosub.lua";
src = fetchFromGitHub {
owner = "davidde";
repo = "mpv-autosub";
rev = "35115355bd339681f97d067538356c29e5b14afa";
hash = "sha256-BKT/Tzwl5ZA4fbdc/cxz0+CYc1zyY/KOXc58x5GYow0=";
};
preInstall = ''
substituteInPlace autosub.lua --replace-fail \
"local subliminal = '/home/david/.local/bin/subliminal'" \
"local subliminal = '${lib.getExe' python3Packages.subliminal "subliminal"}'"
'';
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Fully automatic subtitle downloading for the MPV media player";
homepage = "https://github.com/davidde/mpv-autosub";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.octvs ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
buildLua,
ffsubsync,
}:
buildLua {
pname = "autosubsync-mpv";
version = "0-unstable-2024-10-29";
src = fetchFromGitHub {
owner = "joaquintorres";
repo = "autosubsync-mpv";
rev = "125ac13d1b84b3a64bb2e912225a8356c1c01364";
sha256 = "sha256-Xwu8WTB3p3YDTydfyidF/zpN6CyTQyZgQvGX/HAa9hw=";
};
# While nixpkgs only packages alass, we might as well make that the default
patchPhase = ''
runHook prePatch
substituteInPlace autosubsync.lua \
--replace-warn 'ffsubsync_path = ""' 'ffsubsync_path = "${lib.getExe ffsubsync}"' \
--replace-warn 'audio_subsync_tool = "ask"' 'audio_subsync_tool = "ffsubsync"' \
--replace-warn 'altsub_subsync_tool = "ask"' 'altsub_subsync_tool = "ffsubsync"'
runHook postPatch
'';
scriptPath = "./";
passthru.scriptName = "autosubsync-mpv";
meta = with lib; {
description = "Automatically sync subtitles in mpv using the `n` button";
homepage = "https://github.com/joaquintorres/autosubsync-mpv";
maintainers = with maintainers; [ kovirobi ];
license = licenses.mit;
};
}

View File

@@ -0,0 +1,107 @@
{ lib, stdenvNoCC }:
let
# Escape strings for embedding in shell scripts
escaped = s: "'${lib.escape [ "'" ] s}'";
escapedList = lib.concatMapStringsSep " " escaped;
fileName = pathStr: lib.last (lib.splitString "/" pathStr);
scriptsDir = "$out/share/mpv/scripts";
# similar to `lib.extends`, but with inverted precedence and recursive update
extendedBy =
args: orig: self:
let
super = args self;
in
lib.recursiveUpdate (orig super) super;
in
lib.makeOverridable (
args:
stdenvNoCC.mkDerivation (
extendedBy (if lib.isFunction args then args else (_: args)) (
{
pname,
extraScripts ? [ ],
runtime-dependencies ? [ ],
...
}@args:
let
strippedName =
with builtins;
let
groups = match "mpv[-_](.*)" pname;
in
if groups != null then head groups else pname;
# either passthru.scriptName, inferred from scriptPath, or from pname
scriptName =
(args.passthru or { }).scriptName
or (if args ? scriptPath then fileName args.scriptPath else "${strippedName}.lua");
scriptPath = args.scriptPath or "./${scriptName}";
in
{
dontBuild = true;
preferLocalBuild = true;
# Prevent `patch` from emitting `.orig` files (that end up in the output)
patchFlags = [
"--no-backup-if-mismatch"
"-p1"
];
outputHashMode = "recursive";
installPhase = ''
runHook preInstall
if [ -d "${scriptPath}" ]; then
[ -f "${scriptPath}/main.lua" ] || {
echo "Script directory '${scriptPath}' does not contain 'main.lua'" >&2
exit 1
}
[ ${with builtins; toString (length extraScripts)} -eq 0 ] || {
echo "mpvScripts.buildLua does not support 'extraScripts'" \
"when 'scriptPath' is a directory" >&2
exit 1
}
mkdir -p "${scriptsDir}"
cp -a "${scriptPath}" "${scriptsDir}/${scriptName}"
else
install -m644 -Dt "${scriptsDir}" ${escaped scriptPath}
${lib.optionalString (
extraScripts != [ ]
) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}''}
fi
runHook postInstall
'';
passthru = {
inherit scriptName;
}
// lib.optionalAttrs (runtime-dependencies != [ ]) {
extraWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath runtime-dependencies)
]
++ args.passthru.extraWrapperArgs or [ ];
};
meta = {
platforms = lib.platforms.all;
}
// (
let
pos =
if (args.meta or { }) ? description then
builtins.unsafeGetAttrPos "description" args.meta
else
builtins.unsafeGetAttrPos "pname" args;
in
lib.optionalAttrs (pos != null) { position = "${pos.file}:${toString pos.line}"; }
);
}
)
)
)

View File

@@ -0,0 +1,44 @@
{
lib,
buildLua,
mpv-unwrapped,
}:
let
mkBuiltin =
name: args:
let
srcPath = "TOOLS/lua/${name}.lua";
in
buildLua (
lib.attrsets.recursiveUpdate rec {
inherit (mpv-unwrapped) src version;
pname = "mpv-${name}";
dontUnpack = true;
scriptPath = "${src}/${srcPath}";
meta = {
inherit (mpv-unwrapped.meta) license;
homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}";
};
} args
);
in
lib.recurseIntoAttrs (
lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) {
acompressor.meta = {
description = "Script to toggle and control ffmpeg's dynamic range compression filter";
maintainers = with lib.maintainers; [ nicoo ];
};
autocrop.meta.description = "This script uses the lavfi cropdetect filter to automatically insert a crop filter with appropriate parameters for the currently playing video";
autodeint.meta.description = "This script uses the lavfi idet filter to automatically insert the appropriate deinterlacing filter based on a short section of the currently playing video";
autoload.meta = {
description = "This script automatically loads playlist entries before and after the currently played file";
maintainers = [ lib.maintainers.dawidsowa ];
};
}
)

View File

@@ -0,0 +1,30 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "chapterskip";
version = "0-unstable-2022-09-08";
src = fetchFromGitHub {
owner = "po5";
repo = "chapterskip";
rev = "b26825316e3329882206ae78dc903ebc4613f039";
hash = "sha256-OTrLQE3rYvPQamEX23D6HttNjx3vafWdTMxTiWpDy90=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Automatically skips chapters based on title";
longDescription = ''
MPV script that skips chapters based on their title, categorized using regexes.
The set of skipped categories can be configured globally, or by an auto-profile.
'';
homepage = "https://github.com/po5/chapterskip";
license = lib.licenses.unfree; # https://github.com/po5/chapterskip/issues/10
maintainers = with lib.maintainers; [ nicoo ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
fetchgit,
unstableGitUpdater,
buildLua,
libnotify,
mkvtoolnix-cli,
yad,
}:
buildLua {
pname = "mpv-convert-script";
version = "0-unstable-2015-07-02";
src = fetchgit {
url = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d";
sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck";
};
passthru.updateScript = unstableGitUpdater { };
patches = [ ./convert.patch ];
postPatch = ''
substituteInPlace convert_script.lua \
--replace-fail 'mkvpropedit_exe = "mkvpropedit"' \
'mkvpropedit_exe = "${lib.getExe' mkvtoolnix-cli "mkvpropedit"}"' \
--replace-fail 'mkvmerge_exe = "mkvmerge"' \
'mkvmerge_exe = "${lib.getExe' mkvtoolnix-cli "mkvmerge"}"' \
--replace-fail 'yad_exe = "yad"' \
'yad_exe = "${lib.getExe yad}"' \
--replace-fail 'notify_send_exe = "notify-send"' \
'notify_send_exe = "${lib.getExe libnotify}"' \
'';
scriptPath = "convert_script.lua";
meta = with lib; {
description = "Convert parts of a video while you are watching it in mpv";
homepage = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
maintainers = [ maintainers.Profpatsch ];
longDescription = ''
When this script is loaded into mpv, you can hit Alt+W to mark the beginning
and Alt+W again to mark the end of the clip. Then a settings window opens.
'';
# author was asked to add a license https://gist.github.com/Zehkul/25ea7ae77b30af959be0#gistcomment-3715700
license = licenses.unfree;
};
}

View File

@@ -0,0 +1,102 @@
diff --git "a/Convert Script \342\200\223 README.md" "b/Convert Script \342\200\223 README.md"
index 8e062c1..6e0d798 100644
--- "a/Convert Script \342\200\223 README.md"
+++ "b/Convert Script \342\200\223 README.md"
@@ -68,7 +68,7 @@ and set some options in ``mpv/lua-settings/convert_script.conf`` or with ``--scr
If you dont want to upgrade your yad. Features like appending segments wont be available.
libvpx_fps
- Default: --oautofps
+ Default: ""
FPS settings (or any other settings really) for libvpx encoding. Set it to --ofps=24000/1001 for example.
-Warning: Some of these options arent very robust and setting them to bogus values will break the script.
\ No newline at end of file
+Warning: Some of these options arent very robust and setting them to bogus values will break the script.
diff --git a/convert_script.lua b/convert_script.lua
index 17d3100..90f88ec 100644
--- a/convert_script.lua
+++ b/convert_script.lua
@@ -3,6 +3,12 @@ local msg = require 'mp.msg'
local opt = require 'mp.options'
local utils = require 'mp.utils'
+-- executables
+local mkvpropedit_exe = "mkvpropedit"
+local mkvmerge_exe = "mkvmerge"
+local yad_exe = "yad"
+local notify_send_exe = "notify-send"
+
-- default options, convert_script.conf is read
local options = {
bitrate_multiplier = 0.975, -- to make sure the file wont go over the target file size, set it to 1 if you dont care
@@ -14,7 +20,7 @@ local options = {
libvpx_options = "--ovcopts-add=cpu-used=0,auto-alt-ref=1,lag-in-frames=25,quality=good",
libvpx_vp9_options = "",
legacy_yad = false, -- if you dont want to upgrade to at least yad 0.18
- libvpx_fps = "--oautofps", -- --ofps=24000/1001 for example
+ libvpx_fps = "", -- --ofps=24000/1001 for example
audio_bitrate = 112, -- mpv default, in kbps
}
@@ -247,12 +253,12 @@ function encode(enc)
if string.len(vf) > 0 then
vf = vf .. ","
end
- local sub_file_table = mp.get_property_native("options/sub-file")
+ local sub_file_table = mp.get_property_native("options/sub-files")
local sub_file = ""
for index, param in pairs(sub_file_table) do
sub_file = sub_file .. " --sub-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
end
- local audio_file_table = mp.get_property_native("options/audio-file")
+ local audio_file_table = mp.get_property_native("options/audio-files")
local audio_file = ""
for index, param in pairs(audio_file_table) do
audio_file = audio_file .. " --audio-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
@@ -354,9 +360,9 @@ function encode(enc)
if ovc == "gif" then
full_command = full_command .. ' --vf-add=lavfi=graph=\\"framestep=' .. framestep .. '\\" && convert '
.. tmpfolder .. '/*.png -set delay ' .. delay .. ' -loop 0 -fuzz ' .. fuzz .. '% ' .. dither .. ' -layers optimize '
- .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && notify-send "Gif done") & disown'
+ .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && ' .. notify_send_exe .. ' "Gif done") & disown'
else
- full_command = full_command .. ' && notify-send "Encoding done"; mkvpropedit '
+ full_command = full_command .. ' && ' .. notify_send_exe .. ' "Encoding done"; ' .. mkvpropedit_exe .. ' '
.. full_output_path .. ' -s title="' .. metadata_title .. '") & disown'
end
@@ -409,7 +415,7 @@ function encode_copy(enc)
sep = ",+"
if enc then
- local command = "mkvmerge '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
+ local command = mkvmerge_exe .. " '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
msg.info(command)
os.execute(command)
clear()
@@ -508,7 +514,7 @@ function call_gui ()
end
- local yad_command = [[LC_NUMERIC=C yad --title="Convert Script" --center --form --fixed --always-print-result \
+ local yad_command = [[LC_NUMERIC=C ]] .. yad_exe .. [[ --title="Convert Script" --center --form --fixed --always-print-result \
--name "convert script" --class "Convert Script" --field="Resize to height:NUM" "]] .. scale_sav --yad_table 1
.. [[" --field="Resize to width instead:CHK" ]] .. resize_to_width_instead .. " " --yad_table 2
if options.legacy_yad then
@@ -524,7 +530,7 @@ function call_gui ()
yad_command = yad_command
.. [[--field="2pass:CHK" "false" ]] --yad_table 5
.. [[--field="Encode options::CBE" '! --ovcopts=b=2000,cpu-used=0,auto-alt-ref=1,lag-in-frames=25,quality=good,threads=4' ]] --yad_table 6
- .. [[--field="Output format::CBE" ' --ovc=libx264! --oautofps --of=webm --ovc=libvpx' ]]
+ .. [[--field="Output format::CBE" ' --ovc=libx264! --of=webm --ovc=libvpx' ]]
.. [[--field="Simple:FBTN" 'bash -c "echo \"simple\" && kill -s SIGUSR1 \"$YAD_PID\""' ]]
advanced = true
else
@@ -734,4 +740,4 @@ mp.set_key_bindings({
mp.add_key_binding("alt+w", "convert_script", convert_script_hotkey_call)
-mp.register_event("tick", tick)
\ No newline at end of file
+mp.register_event("tick", tick)

View File

@@ -0,0 +1,48 @@
{
lib,
buildLua,
fetchFromGitHub,
makeWrapper,
unstableGitUpdater,
}:
buildLua {
pname = "video-cutter";
version = "0-unstable-2023-11-10";
src = fetchFromGitHub {
owner = "rushmj";
repo = "mpv-video-cutter";
rev = "01a0396c075d5f8bbd1de5b571e6231f8899ab65";
sha256 = "sha256-veoRFzUCRH8TrvR7x+WWoycpDyxqrJZ/bnp61dVc0pE=";
};
passthru.updateScript = unstableGitUpdater { };
nativeBuildInputs = [ makeWrapper ];
postPatch = ''
substituteInPlace cutter.lua \
--replace-fail '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
# needs to be ran separately so that we can replace everything, and not every single mention explicitly
# original script places them in the scripts folder, just spawning unnecessary errors
# i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream
substituteInPlace cutter.lua \
--replace-fail '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
'';
passthru.scriptName = "cutter.lua";
extraScripts = [ "c_concat.sh" ];
postInstall = ''
wrapProgram $out/share/mpv/scripts/c_concat.sh \
--run "mkdir -p ~/.config/mpv/cutter/"
'';
meta = with lib; {
description = "Cut videos and concat them automatically";
homepage = "https://github.com/rushmj/mpv-video-cutter";
license = licenses.mit;
maintainers = with maintainers; [ lom ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "dynamic-crop";
version = "0-unstable-2024-09-14";
src = fetchFromGitHub {
owner = "Ashyni";
repo = "mpv-scripts";
rev = "d3f5685f5209ae548f8398b21d4dcbbea766d076";
hash = "sha256-9v8ZsBj9F5Odhfo/iWGA3Ak/+gFrbe0FldrTyCKF6tk=";
};
passthru.scriptName = "dynamic-crop.lua";
passthru.updateScript = unstableGitUpdater { };
meta = {
description = ''Script to "cropping" dynamically, hard-coded black bars detected with lavfi-cropdetect filter for Ultra Wide Screen or any screen (Smartphone/Tablet)'';
homepage = "https://github.com/Ashyni/mpv-scripts";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.iynaix ];
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
buildLua,
fetchFromGitHub,
unstableGitUpdater,
}:
buildLua {
pname = "easycrop";
version = "0-unstable-2018-01-24";
src = fetchFromGitHub {
owner = "aidanholm";
repo = "mpv-easycrop";
rev = "b8a67bb9039e19dec54d92ea57076c0c98e981aa";
hash = "sha256-VRQP8j/Z/OvVqrEpvWcLmJFotxbTRynHoqvfIQIQmqY=";
};
scriptPath = "easycrop.lua";
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Manually crop videos during playback in mpv";
longDescription = ''
A simple mpv script for manually cropping videos with ease.
- Works during video playback
- No need to re-encode or modify video files
Press "c" to begin cropping. Click at one corner of the desired
cropping rectangle, and click a second time at the opposite
corner; the video will be cropped immediately. Pressing "c" again
will undo the current crop.
If you wish to use a key other than "c" to crop, the keybind
`easy_crop` can be changed.
'';
homepage = "https://github.com/aidanholm/mpv-easycrop";
license = lib.licenses.gpl3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ RossSmyth ];
};
}

View File

@@ -0,0 +1,89 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
xclip,
}:
let
mkScript =
pname: args:
let
self = {
inherit pname;
version = "25-09-2023-unstable-2025-06-21";
src = fetchFromGitHub {
owner = "Eisa01";
repo = "mpv-scripts";
rev = "b9e63743a858766c9cc7a801d77313b0cecdb049";
hash = "sha256-ohUZH6m+5Sk3VKi9qqEgwhgn2DMOFIvvC41pMkV6oPw=";
# avoid downloading screenshots and videos
sparseCheckout = [
"scripts/"
"script-opts/"
];
};
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
homepage = "https://github.com/Eisa01/mpv-scripts";
license = licenses.bsd2;
};
# Sadly needed to make `common-updaters` work here
pos = builtins.unsafeGetAttrPos "version" self;
};
in
buildLua (lib.attrsets.recursiveUpdate self args);
in
lib.recurseIntoAttrs (
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
smart-copy-paste-2 = {
scriptPath = "scripts/SmartCopyPaste_II.lua";
prePatch = ''
substituteInPlace $scriptPath --replace-fail 'xclip' "${lib.getExe xclip}"
'';
meta = {
description = "Smart copy paste with logging and clipboard support";
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
};
};
simplebookmark = {
scriptPath = "scripts/SimpleBookmark.lua";
meta = {
description = "Simple bookmarks script based on assigning keys";
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
};
};
simplehistory = {
scriptPath = "scripts/SimpleHistory.lua";
meta = {
description = "Store videos in a history file, continue watching your last played or resume previously played videos, manage and play from your history, and more";
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
};
};
smartskip = {
scriptPath = "scripts/SmartSkip.lua";
meta = {
description = "Automatically or manually skip opening, intro, outro, and preview";
maintainers = with lib.maintainers; [ iynaix ];
};
};
undoredo = {
scriptPath = "scripts/UndoRedo.lua";
meta = {
description = "Undo / redo any accidental time jumps";
maintainers = with lib.maintainers; [ iynaix ];
};
};
}
)

View File

@@ -0,0 +1,28 @@
{
fetchFromGitHub,
buildLua,
lib,
unstableGitUpdater,
}:
buildLua {
pname = "evafast";
version = "0-unstable-2024-02-09";
src = fetchFromGitHub {
owner = "po5";
repo = "evafast";
rev = "92af3e2e1c756ce83f9d0129c780caeef1131a0b";
hash = "sha256-BGWD2XwVu8zOSiDJ+9oWi8aPN2Wkw0Y0gF58X4f+tdI=";
};
# Drop the `branch` parameter once upstream merges `rewrite` back into `master`
passthru.updateScript = unstableGitUpdater { branch = "rewrite"; };
meta = with lib; {
description = "Seeking and hybrid fastforwarding like VHS";
homepage = "https://github.com/po5/evafast";
license = licenses.unfree; # no license; see https://github.com/po5/evafast/issues/15
maintainers = with lib.maintainers; [ purrpurrn ];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
pkg-config,
dbus,
mpv-unwrapped,
}:
stdenv.mkDerivation rec {
pname = "mpv-inhibit-gnome";
version = "0.1.3";
src = fetchFromGitHub {
owner = "Guldoman";
repo = "mpv_inhibit_gnome";
rev = "v${version}";
hash = "sha256-LSGg5gAQE2JpepBqhz6D6d3NlqYaU4bjvYf1F+oLphQ=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
nativeBuildInputs = [ pkg-config ];
buildInputs = [
dbus
mpv-unwrapped
];
passthru.scriptName = "mpv_inhibit_gnome.so";
installPhase = ''
install -D ./lib/mpv_inhibit_gnome.so $out/share/mpv/scripts/mpv_inhibit_gnome.so
'';
meta = with lib; {
description = "This mpv plugin prevents screen blanking in GNOME";
homepage = "https://github.com/Guldoman/mpv_inhibit_gnome";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ myaats ];
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "manga-reader";
version = "0-unstable-2025-07-15";
src = fetchFromGitHub {
owner = "Dudemanguy";
repo = "mpv-manga-reader";
rev = "bb4ec1208feb440ce430f0963373ab2db5b7d743";
hash = "sha256-Zz2rPnnQHz2BqCM3jEJD/FuFLKtiNGWvAZpiH7jyLmo=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Manga reading script for mpv";
longDescription = ''
mpv-manga-reader is a script aimed at making mpv a usable manga reader.
'';
homepage = "https://github.com/Dudemanguy/mpv-manga-reader";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ idlip ];
};
}

View File

@@ -0,0 +1,27 @@
{
fetchFromGitHub,
buildLua,
lib,
unstableGitUpdater,
}:
buildLua {
pname = "memo";
version = "0-unstable-2024-09-03";
src = fetchFromGitHub {
owner = "po5";
repo = "memo";
rev = "e0624611438b2e19ef4b7e24f53461c9d0304b07";
hash = "sha256-6+fI3TdBDfKcozxLcsykavgi17ywqRRhyiMK7PgAzGs=";
};
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Recent files menu for mpv";
homepage = "https://github.com/po5/memo";
license = licenses.gpl3Only;
maintainers = with lib.maintainers; [ purrpurrn ];
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
buildLua,
fetchFromGitHub,
makeFontsConf,
nix-update-script,
}:
buildLua (finalAttrs: {
pname = "modernx-zydezu";
version = "0.4.3";
scriptPath = "modernx.lua";
src = fetchFromGitHub {
owner = "zydezu";
repo = "ModernX";
rev = finalAttrs.version;
hash = "sha256-vveDQsvMVt9DYFM1Ong7/Gx5P9jMq/BEj2AhSuW6tRI=";
};
postInstall = ''
mkdir -p $out/share/fonts
cp -r *.ttf $out/share/fonts
'';
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Modern OSC UI replacement for MPV that retains the functionality of the default OSC";
changelog = "https://github.com/zydezu/ModernX/releases/tag/${finalAttrs.version}";
homepage = "https://github.com/zydezu/ModernX";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [
luftmensch-luftmensch
Guanran928
];
};
})

View File

@@ -0,0 +1,40 @@
{
lib,
buildLua,
fetchFromGitHub,
makeFontsConf,
nix-update-script,
}:
buildLua (finalAttrs: {
pname = "modernx";
version = "0.6.1";
scriptPath = "modernx.lua";
src = fetchFromGitHub {
owner = "cyl0";
repo = "ModernX";
rev = finalAttrs.version;
hash = "sha256-q7DwyfmOIM7K1L7vvCpq1EM0RVpt9E/drhAa9rLYb1k=";
};
postInstall = ''
mkdir -p $out/share/fonts
cp -r *.ttf $out/share/fonts
'';
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
];
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Modern OSC UI replacement for MPV that retains the functionality of the default OSC";
homepage = "https://github.com/cyl0/ModernX";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ Guanran928 ];
};
})

View File

@@ -0,0 +1,40 @@
{
lib,
buildLua,
fetchFromGitHub,
makeFontsConf,
nix-update-script,
}:
buildLua (finalAttrs: {
pname = "modernz";
version = "0.2.8";
scriptPath = "modernz.lua";
src = fetchFromGitHub {
owner = "Samillion";
repo = "ModernZ";
rev = "v${finalAttrs.version}";
hash = "sha256-pQttcfCaw9K8BD/T2CZdRAb9QEFobyeUj/KmNStgzEg=";
};
postInstall = ''
install -Dt $out/share/fonts *.ttf
'';
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Sleek and modern OSC for mpv designed to enhance functionality by adding more features, all while preserving the core standards of mpv's OSC";
homepage = "https://github.com/Samillion/ModernZ";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ Guanran928 ];
};
})

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
pkg-config,
glib,
mpv-unwrapped,
ffmpeg,
}:
stdenv.mkDerivation rec {
pname = "mpv-mpris";
version = "1.1";
src = fetchFromGitHub {
owner = "hoyon";
repo = "mpv-mpris";
rev = version;
hash = "sha256-vZIO6ILatIWa9nJYOp4AMKwvaZLahqYWRLMDOizyBI0=";
};
passthru.updateScript = gitUpdater { };
nativeBuildInputs = [ pkg-config ];
buildInputs = [
glib
mpv-unwrapped
ffmpeg
];
postPatch = ''
substituteInPlace Makefile --replace-fail 'PKG_CONFIG =' 'PKG_CONFIG ?='
'';
installFlags = [ "SCRIPTS_DIR=${placeholder "out"}/share/mpv/scripts" ];
# Otherwise, the shared object isn't `strip`ped. See:
# https://discourse.nixos.org/t/debug-why-a-derivation-has-a-reference-to-gcc/7009
stripDebugList = [ "share/mpv/scripts" ];
passthru.scriptName = "mpris.so";
meta = {
description = "MPRIS plugin for mpv";
homepage = "https://github.com/hoyon/mpv-mpris";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ ajs124 ];
changelog = "https://github.com/hoyon/mpv-mpris/releases/tag/${version}";
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
fetchFromGitHub,
gitUpdater,
nodePackages,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "mpv-cheatsheet";
version = "0.30.0.2";
src = fetchFromGitHub {
owner = "ento";
repo = "mpv-cheatsheet";
rev = "v${finalAttrs.version}";
hash = "sha256-MWK0CYto3zgn3fivmL43tvgZn6XrjPxKLp0lgTFdplM=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
nativeBuildInputs = [ nodePackages.browserify ];
buildPhase = ''
runHook preBuild
make dist/${finalAttrs.passthru.scriptName}
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D dist/${finalAttrs.passthru.scriptName} $out/share/mpv/scripts/${finalAttrs.passthru.scriptName}
runHook postInstall
'';
passthru.scriptName = "cheatsheet.js";
meta = with lib; {
description = "mpv script for looking up keyboard shortcuts";
homepage = "https://github.com/ento/mpv-cheatsheet";
license = licenses.mit;
maintainers = with maintainers; [ ambroisie ];
};
})

View File

@@ -0,0 +1,44 @@
{
fetchFromGitHub,
buildGoModule,
buildLua,
lib,
}:
let
version = "1.6.1";
src = fetchFromGitHub {
owner = "tnychn";
repo = "mpv-discord";
rev = "v${version}";
hash = "sha256-P1UaXGboOiqrXapfLzJI6IT3esNtflkQkcNXt4Umukc=";
};
core = buildGoModule {
name = "mpv-discord-core";
inherit version;
src = "${src}/mpv-discord";
vendorHash = "sha256-xe1jyWFQUD+Z4qBAVQ0SBY0gdxmi5XG9t29n3f/WKDs=";
};
in
buildLua {
pname = "mpv-discord";
inherit version src;
scriptPath = "scripts/discord.lua";
postInstall = ''
substituteInPlace $out/share/mpv/scripts/discord.lua \
--replace-fail 'binary_path = ""' 'binary_path = "${core}/bin/mpv-discord"'
'';
meta = {
description = "Cross-platform Discord Rich Presence integration for mpv with no external dependencies";
homepage = "https://github.com/tnychn/mpv-discord";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ bddvlpr ];
};
}

View File

@@ -0,0 +1,58 @@
{
buildLua,
fetchFromGitHub,
lib,
unstableGitUpdater,
}:
let
mkScript =
pname: args:
let
self = {
inherit pname;
version = "0-unstable-2024-11-23";
src = fetchFromGitHub {
owner = "occivink";
repo = "mpv-image-viewer";
rev = "128b498e3e57a14deea5ca9bbf662f8c1ca79e8d";
hash = "sha256-VwIL1529CW9MLK4N9jHHddSSZD5RsJ5bWGWqGJ751C0=";
};
sourceRoot = "${self.src.name}/scripts";
passthru = {
updateScript = unstableGitUpdater { };
};
meta = {
description = "Configuration, scripts and tips for using mpv as an image viewer";
longDescription = ''
${pname} is a component of mpv-image-viewer.
mpv-image-viewer aggregates configurations, scripts and tips for using
mpv as an image viewer. The affectionate nickname mvi is given to mpv in
such case.
Each mpv-image-viewer script can be used on its own without depending on
any of the others. Refer to the README and script-opts/ directory for
additional configuration tips or examples.
'';
homepage = "https://github.com/occivink/mpv-image-viewer";
license = lib.licenses.unlicense;
maintainers = with lib.maintainers; [ colinsane ];
};
};
in
buildLua (lib.attrsets.recursiveUpdate self args);
in
lib.recurseIntoAttrs (
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
detect-image.meta.description = "Allows you to run specific commands when images are being displayed. Does not do anything by default, needs to be configured through detect_image.conf";
equalizer = { };
freeze-window.meta.description = "By default, mpv automatically resizes the window when the current file changes to fit its size. This script freezes the window so that this does not happen. There is no configuration";
image-positioning.meta.description = "Adds several high-level commands to zoom and pan";
minimap.meta.description = "Adds a minimap that displays the position of the image relative to the view";
ruler.meta.description = "Adds a ruler command that lets you measure positions, distances and angles in the image. Can be configured through ruler.conf";
status-line.meta.description = "Adds a status line that can show different properties in the corner of the window. By default it shows filename [positon/total] in the bottom left";
}
)

View File

@@ -0,0 +1,35 @@
{
lib,
buildLua,
fetchFromGitHub,
unstableGitUpdater,
libnotify,
}:
buildLua {
pname = "mpv-notify-send";
version = "0-unstable-2024-07-11";
src = fetchFromGitHub {
owner = "Parranoh";
repo = "mpv-notify-send";
rev = "d98d9fe566b222c5b909e3905e9e201eaec34959";
hash = "sha256-H8WIKfQnle27eiwnz2sxC8D1EwQplY4N7Qg5+c1e/uU=";
};
passthru.extraWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ libnotify ])
];
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Lua script for mpv to send notifications with notify-send";
homepage = "https://github.com/Parranoh/mpv-notify-send";
license = lib.licenses.wtfpl;
maintainers = with lib.maintainers; [ r3n3gad3p3arl ];
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
buildLua,
fetchFromGitHub,
makeFontsConf,
nix-update-script,
}:
buildLua (finalAttrs: {
pname = "mpv-osc-modern";
version = "1.1.1";
scriptPath = "modern.lua";
src = fetchFromGitHub {
owner = "maoiscat";
repo = "mpv-osc-modern";
rev = "v${finalAttrs.version}";
hash = "sha256-RMUy8UpSRSCEPAbnGLpJ2NjDsDdkjq8cNsdGwsQ5ANU=";
};
postInstall = ''
mkdir -p $out/share/fonts
cp -r *.ttf $out/share/fonts
'';
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
];
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Another MPV OSC Script";
homepage = "https://github.com/maoiscat/mpv-osc-modern";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ Guanran928 ];
};
})

View File

@@ -0,0 +1,26 @@
{
lib,
buildLua,
fetchFromGitHub,
}:
buildLua (finalAttrs: {
pname = "mpv-osc-tethys";
version = "0-unstable-2024-08-19";
scriptPath = "osc_tethys.lua";
extraScripts = [ "mpv_thumbnail_script_server.lua" ];
src = fetchFromGitHub {
owner = "Zren";
repo = "mpv-osc-tethys";
rev = "c4167f88a0e9944738419e90a71f1f80fba39ccb";
hash = "sha256-eAY+ZUuOxPJiNCuL7lqMBU4iURCMz12LQdfaYj4WFQc=";
};
meta = {
description = "OSC UI replacement for MPV with icons from the bomi video player";
homepage = "https://github.com/Zren/mpv-osc-tethys";
license = lib.licenses.unfree; # no license specified
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
};
})

View File

@@ -0,0 +1,33 @@
{
lib,
buildLua,
fetchFromGitHub,
unstableGitUpdater,
yt-dlp,
}:
buildLua {
pname = "mpv-playlistmanager";
version = "0-unstable-2025-09-03";
src = fetchFromGitHub {
owner = "jonniek";
repo = "mpv-playlistmanager";
rev = "b11621e1dc4afd24b41b887aff0748146176c4c1";
hash = "sha256-0+ISjWb8aGdRjsFOPURBZzTmJ4X8ayzYfnxYICDmizA=";
};
passthru.updateScript = unstableGitUpdater { };
postPatch = ''
substituteInPlace playlistmanager.lua \
--replace-fail 'youtube_dl_executable = "yt-dlp",' \
'youtube_dl_executable = "${lib.getExe yt-dlp}"',
'';
meta = with lib; {
description = "Mpv lua script to create and manage playlists";
homepage = "https://github.com/jonniek/mpv-playlistmanager";
license = licenses.unlicense;
maintainers = with maintainers; [ lunik1 ];
};
}

View File

@@ -0,0 +1,34 @@
{
lib,
buildLua,
fetchFromGitHub,
ffmpeg,
unstableGitUpdater,
}:
buildLua {
pname = "mpv-slicing";
version = "0-unstable-2017-11-25";
src = fetchFromGitHub {
owner = "Kagami";
repo = "mpv_slicing";
rev = "d09c11227704c8d5bdaa2c799ef64dce881c63a7";
hash = "sha256-MKoM0f74/XoctiHQVOB3LzFWtJXpsREfQh5icaebCJo=";
};
passthru.updateScript = unstableGitUpdater { };
postPatch = ''
substituteInPlace slicing.lua \
--replace-fail ffmpeg ${lib.getExe ffmpeg}
'';
passthru.scriptName = "slicing.lua";
meta = {
description = "Lua script to cut fragments of the video in uncompressed RGB format";
homepage = "https://github.com/Kagami/mpv_slicing";
license = lib.licenses.cc0;
maintainers = with lib.maintainers; [ tomasajt ];
};
}

View File

@@ -0,0 +1,27 @@
{
fetchFromGitHub,
buildLua,
lib,
unstableGitUpdater,
}:
buildLua {
pname = "mpv-subtitle-lines";
version = "0-unstable-2024-05-19";
src = fetchFromGitHub {
owner = "christoph-heinrich";
repo = "mpv-subtitle-lines";
rev = "f0a85c7ba3370b490c46a77dcb2e212c0b149a50";
hash = "sha256-m9LHIz/hAOEq0DzHY3Jd1LM1cfxZng6Iaqrug1PfnAE=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "List and search subtitle lines of the selected subtitle track";
homepage = "https://github.com/christoph-heinrich/mpv-subtitle-lines";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ purrpurrn ];
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
buildLua,
fetchFromGitHub,
luaPackages,
unstableGitUpdater,
}:
buildLua {
pname = "mpv-webm";
version = "0-unstable-2025-07-14";
src = fetchFromGitHub {
owner = "ekisu";
repo = "mpv-webm";
rev = "e15234567d2064791319df1e6193fcb433602d08";
hash = "sha256-C1N+fY5Xv6Y6tG3mTdymSlLlLYaA7XUvM0PZtkBTS4k=";
};
passthru.updateScript = unstableGitUpdater {
# only "latest" tag pointing at HEAD
hardcodeZeroVersion = true;
};
dontBuild = false;
nativeBuildInputs = [ luaPackages.moonscript ];
scriptPath = "build/webm.lua";
meta = with lib; {
description = "Simple WebM maker for mpv, with no external dependencies";
homepage = "https://github.com/ekisu/mpv-webm";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ pbsds ];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
buildLua,
fetchFromGitHub,
gitUpdater,
curl,
wl-clipboard,
xclip,
}:
buildLua rec {
pname = "mpvacious";
version = "0.40";
src = fetchFromGitHub {
owner = "Ajatt-Tools";
repo = "mpvacious";
rev = "v${version}";
sha256 = "sha256-PxLbv9aGVQV4Gea2H/GcWv/yuaRSqBRqbzRXu612kLE=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
postPatch = ''
substituteInPlace utils/forvo.lua \
--replace-fail "'curl" "'${lib.getExe curl}"
substituteInPlace platform/nix.lua \
--replace-fail "'curl" "'${lib.getExe curl}" \
--replace-fail "'wl-copy" "'${lib.getExe' wl-clipboard "wl-copy"}" \
--replace-fail "'xclip" "'${lib.getExe xclip}"
'';
installPhase = ''
runHook preInstall
make PREFIX=$out/share/mpv install
runHook postInstall
'';
passthru.scriptName = "mpvacious";
meta = with lib; {
description = "Adds mpv keybindings to create Anki cards from movies and TV shows";
homepage = "https://github.com/Ajatt-Tools/mpvacious";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ kmicklas ];
};
}

View File

@@ -0,0 +1,62 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
ffmpeg,
}:
let
camelToKebab =
let
inherit (lib.strings) match stringAsChars toLower;
isUpper = match "[A-Z]";
in
stringAsChars (c: if isUpper c != null then "-${toLower c}" else c);
mkScript =
name: args:
let
self = rec {
pname = camelToKebab name;
version = "0-unstable-2025-03-09";
src = fetchFromGitHub {
owner = "occivink";
repo = "mpv-scripts";
rev = "65aa1da29570e9c21b49292725ec5dd719ab6bb4";
hash = "sha256-pca24cZY2ZNxkY1XP2T2WKo1UbD8gsGn+EskGH+CggE=";
};
passthru.updateScript = unstableGitUpdater { };
scriptPath = "scripts/${pname}.lua";
meta = with lib; {
homepage = "https://github.com/occivink/mpv-scripts";
license = licenses.unlicense;
maintainers = with maintainers; [ nicoo ];
};
# Sadly needed to make `common-updaters` work here
pos = builtins.unsafeGetAttrPos "version" self;
};
in
buildLua (lib.attrsets.recursiveUpdate self args);
in
lib.recurseIntoAttrs (
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
crop.meta.description = "Crop the current video in a visual manner";
seekTo.meta.description = "Mpv script for seeking to a specific position";
blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension";
encode = {
meta.description = "Make an extract of the video currently playing using ffmpeg";
postPatch = ''
substituteInPlace scripts/encode.lua \
--replace-fail '"ffmpeg"' '"${lib.getExe ffmpeg}"'
'';
};
}
)

View File

@@ -0,0 +1,33 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "mpv-quack";
version = "0-unstable-2020-05-27";
src = fetchFromGitHub {
owner = "CounterPillow";
repo = "mpv-quack";
rev = "1c87f36f9726d462dd112188c04be54d85692cf3";
hash = "sha256-dEnJbS8RJoAxpKINdoMHN4l7vpEdf7+C5JVWpK0VXMw=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Reduce audio volume after seeking";
longDescription = ''
quack is an mpv script to temporarily reduce the volume after a seek,
in order to avoid loud noises when scrubbing through a movie.
The volume is linearly increased back up to its original level.
Repeated seeks before the transition is done work as well.
'';
homepage = "https://github.com/CounterPillow/mpv-quack";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ nicoo ];
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
buildLua,
fetchFromGitHub,
gitUpdater,
oscSupport ? false,
}:
buildLua rec {
pname = "mpv-quality-menu";
version = "4.2.1";
src = fetchFromGitHub {
owner = "christoph-heinrich";
repo = "mpv-quality-menu";
rev = "v${version}";
hash = "sha256-W+6OYjh0S7nYrNC/P9sF7t6p1Rt/awOtO865cr6qtR0=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
extraScripts = lib.optional oscSupport "quality-menu-osc.lua";
meta = with lib; {
description = "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 ];
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "mpv-reload";
version = "0-unstable-2024-03-22";
src = fetchFromGitHub {
owner = "4e6";
repo = "mpv-reload";
rev = "1a6a9383ba1774708fddbd976e7a9b72c3eec938";
hash = "sha256-BshxCjec/UNGyiC0/g1Rai2NvG2qOIHXDDEUYwwdij0=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Manual & automatic reloading of videos";
longDescription = ''
This script adds reloading of videos, automatically on timers (when stuck
buffering etc.) or manually on keybinds, to help with cases where a stream
is not loading further due to a network or remote issue.
'';
homepage = "https://github.com/4e6/mpv-reload";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ nicoo ];
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
buildLua,
fetchFromGitHub,
gitUpdater,
}:
buildLua rec {
pname = "simple-mpv-ui";
version = "3.0.0";
src = fetchFromGitHub {
owner = "open-dynaMIX";
repo = "simple-mpv-webui";
rev = "v${version}";
hash = "sha256-I8lwpo3Hfpy3UnPMmHEJCdArVQnNL245NkxsYVmnMF0=";
sparseCheckout = [
"main.lua"
"webui-page"
];
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
postInstall = ''
rm -f $out/share/mpv/scripts/webui/setup.cfg
'';
scriptPath = ".";
passthru.scriptName = "webui";
meta = with lib; {
description = "Web based user interface with controls for the mpv mediaplayer";
homepage = "https://github.com/open-dynaMIX/simple-mpv-webui";
maintainers = with maintainers; [
cript0nauta
zopieux
];
longDescription = ''
You can access the webui when accessing http://127.0.0.1:8080 or
http://[::1]:8080 in your webbrowser. By default it listens on
0.0.0.0:8080 and [::0]:8080
'';
license = licenses.mit;
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
}:
buildLua {
pname = "mpv-skipsilence";
version = "0-unstable-2025-09-06";
src = fetchFromGitHub {
owner = "ferreum";
repo = "mpv-skipsilence";
rev = "75e1334e513682f0ece6790c614c1fcbd82257cc";
hash = "sha256-XmrVZRJAQctIiuznw/fQzs+9+QKOyTnJI2JOEWBWnVA=";
};
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Increase playback speed during silence";
homepage = "https://github.com/ferreum/mpv-skipsilence";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ mksafavi ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildLua,
fetchFromGitea,
unstableGitUpdater,
curl,
coreutils,
}:
buildLua {
pname = "mpv_sponsorblock_minimal";
version = "0-unstable-2025-09-09";
scriptPath = "sponsorblock_minimal.lua";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "jouni";
repo = "mpv_sponsorblock_minimal";
rev = "fc0db1fbffc873ca02ced7602274393fde8857e5";
hash = "sha256-DOgJ1gZybfIFJQ5qt4B93ugHz1o+RJ7E8Cnb7itYfTs=";
};
passthru.updateScript = unstableGitUpdater { };
preInstall = ''
substituteInPlace sponsorblock_minimal.lua \
--replace-fail "curl" "${lib.getExe curl}" \
--replace-fail "sha256sum" "${lib.getExe' coreutils "sha256sum"}"
'';
meta = with lib; {
description = "Minimal script to skip sponsored segments of YouTube videos";
homepage = "https://codeberg.org/jouni/mpv_sponsorblock_minimal";
license = licenses.gpl3Only;
platforms = platforms.all;
maintainers = with maintainers; [ arthsmn ];
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
buildLua,
fetchFromGitHub,
fetchpatch,
python3,
nix-update-script,
}:
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }`
buildLua {
pname = "mpv_sponsorblock";
version = "0-unstable-2023-01-30";
src = fetchFromGitHub {
owner = "po5";
repo = "mpv_sponsorblock";
rev = "7785c1477103f2fafabfd65fdcf28ef26e6d7f0d";
sha256 = "sha256-iUXaTWWFEdxhxClu2NYbQcThlvYty3A2dEYGooeAVAQ=";
};
patches = [
# Use XDG_DATA_HOME and XDG_CACHE_HOME if defined for UID and DB
# Necessary to avoid sponsorblock to write in the nix store at runtime.
# https://github.com/po5/mpv_sponsorblock/pull/17
(fetchpatch {
url = "https://github.com/po5/mpv_sponsorblock/pull/17/commits/e65b360a7d03a3430b4829e457a6670b2f617b09.patch";
sha256 = "00wv0pvbz0dz2ibka66zhl2jk0pil4pyv6ipjfz37i81q6szyhs5";
})
(fetchpatch {
url = "https://github.com/po5/mpv_sponsorblock/pull/17/commits/3832304d959205e99120a14c0560ed3c37104b08.patch";
sha256 = "149ffvn714n2m3mqs8mgrbs24bcr74kqfkx7wyql36ndhm88xd2z";
})
];
postPatch = ''
substituteInPlace sponsorblock.lua \
--replace-fail "python3" "${lib.getExe python3}" \
--replace-fail 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
'';
extraScripts = [ "sponsorblock_shared" ];
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
meta = with lib; {
description = "Script for mpv to skip sponsored segments of YouTube videos";
homepage = "https://github.com/po5/mpv_sponsorblock";
license = licenses.gpl3;
maintainers = with maintainers; [ euxane ];
};
}

View File

@@ -0,0 +1,34 @@
{
lib,
fetchFromGitHub,
unstableGitUpdater,
buildLua,
mpv-unwrapped,
}:
buildLua {
pname = "mpv-thumbfast";
version = "0-unstable-2025-02-04";
src = fetchFromGitHub {
owner = "po5";
repo = "thumbfast";
rev = "9deb0733c4e36938cf90e42ddfb7a19a8b2f4641";
hash = "sha256-avG1CRBrs0UM4HcFMUVAQyOtcIFkZ/H+PbjZJKU7o2A=";
};
passthru.updateScript = unstableGitUpdater { };
passthru.extraWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ mpv-unwrapped ])
];
meta = {
description = "High-performance on-the-fly thumbnailer for mpv";
homepage = "https://github.com/po5/thumbfast";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ apfelkuchen6 ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildLua,
fetchFromGitHub,
gitUpdater,
python3,
}:
buildLua rec {
pname = "mpv-thumbnail-script";
version = "0.5.4";
src = fetchFromGitHub {
owner = "marzzzello";
repo = "mpv_thumbnail_script";
rev = version;
sha256 = "sha256-nflavx25skLj9kitneL6Uz3zI2DyMMhQC595npofzbQ=";
};
passthru.updateScript = gitUpdater { };
nativeBuildInputs = [ python3 ];
postPatch = "patchShebangs concat_files.py";
dontBuild = false;
scriptPath = "mpv_thumbnail_script_client_osc.lua";
extraScripts = [ "mpv_thumbnail_script_server.lua" ];
passthru.scriptName = "mpv_thumbnail_script_{client_osc,server}.lua";
meta = {
description = "Lua script to show preview thumbnails in mpv's OSC seekbar";
homepage = "https://github.com/marzzzello/mpv_thumbnail_script";
changelog = "https://github.com/marzzzello/mpv_thumbnail_script/releases/tag/${version}";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ figsoda ];
};
}

View File

@@ -0,0 +1,35 @@
{
buildLua,
curl,
fetchFromGitHub,
lib,
nix-update-script,
}:
buildLua {
pname = "twitch-chat";
version = "0-unstable-2025-05-15";
src = fetchFromGitHub {
owner = "CrendKing";
repo = "mpv-twitch-chat";
rev = "4d88ac12c843da0e916b0ed1df4d087a3418501b";
hash = "sha256-owU0F976K4CX0kKYoRbdtz/sqCvd8kw2LqItEgY25gE=";
postFetch = "rm $out/screenshot.webp";
};
scriptPath = ".";
runtime-dependencies = [ curl ];
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
description = "Show Twitch chat messages as subtitles when watching Twitch VOD with mpv";
homepage = "https://github.com/CrendKing/mpv-twitch-chat";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.naho ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
fetchFromGitHub,
gitUpdater,
makeFontsConf,
buildLua,
buildGoModule,
}:
buildLua (finalAttrs: {
pname = "uosc";
version = "5.12.0";
scriptPath = "src/uosc";
src = fetchFromGitHub {
owner = "tomasklaen";
repo = "uosc";
rev = finalAttrs.version;
hash = "sha256-vSs6X++WIM9NfTvcsJgwiKmTuU0eu3i3cffsdCVSyV4=";
};
passthru.updateScript = gitUpdater { };
tools = buildGoModule {
pname = "uosc-bin";
inherit (finalAttrs) version src;
vendorHash = "sha256-oRXChHeVQj6nXvKOVV125sM8wD33Dxxv0r/S7sl6SxQ=";
};
# the script uses custom "texture" fonts as the background for ui elements.
# In order for mpv to find them, we need to adjust the fontconfig search path.
postInstall = "cp -r src/fonts $out/share";
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
"--set"
"MPV_UOSC_ZIGGY"
(lib.getExe' finalAttrs.tools "ziggy")
];
meta = with lib; {
description = "Feature-rich minimalist proximity-based UI for MPV player";
homepage = "https://github.com/tomasklaen/uosc";
license = licenses.gpl3Only;
maintainers = with lib.maintainers; [ apfelkuchen6 ];
};
})

View File

@@ -0,0 +1,42 @@
{
lib,
fetchFromGitHub,
curl,
xclip,
wl-clipboard,
stdenv,
buildLua,
unstableGitUpdater,
}:
buildLua {
pname = "videoclip";
version = "0-unstable-2025-03-10";
src = fetchFromGitHub {
owner = "Ajatt-Tools";
repo = "videoclip";
rev = "785eb86bc080c445e8feb947d7caa8f3a097bf2b";
hash = "sha256-oanc9MggMjVDrSW42XrQwwWw2YTrifiCVrg/r42oGx8=";
};
patchPhase = ''
substituteInPlace platform.lua \
--replace \'curl\' \'${lib.getExe curl}\' \
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
--replace xclip ${lib.getExe xclip} \
--replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"}
'';
scriptPath = ".";
passthru.scriptName = "videoclip";
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Easily create videoclips with mpv";
homepage = "https://github.com/Ajatt-Tools/videoclip";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ BatteredBunny ];
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
buildLua,
fetchFromGitHub,
unstableGitUpdater,
}:
buildLua {
pname = "visualizer";
version = "0-unstable-2025-04-12";
src = fetchFromGitHub {
owner = "mfcc64";
repo = "mpv-scripts";
rev = "bf6776f5c3dae8d83ba29b820496af89dc436613";
sha256 = "9ApUBXjH4TKPP4P/fUXSNYbJu2AH6HBYt+1K+sHB7yE=";
};
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Various audio visualization";
homepage = "https://github.com/mfcc64/mpv-scripts";
maintainers = with maintainers; [ kmein ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
gitUpdater,
ffmpeg,
}:
stdenvNoCC.mkDerivation rec {
pname = "vr-reversal";
version = "1.1";
src = fetchFromGitHub {
owner = "dfaker";
repo = "vr-reversal";
rev = "v${version}";
sha256 = "1wn2ngcvn7wcsl3kmj782x5q9130qw951lj6ilrkafp6q6zscpqr";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
dontBuild = true;
# reset_rot is only available in ffmpeg 5.0, see 5bcc61ce87922ecccaaa0bd303a7e195929859a8
postPatch = lib.optionalString (lib.versionOlder ffmpeg.version "5.0") ''
substituteInPlace 360plugin.lua --replace-fail ":reset_rot=1:" ":"
'';
installPhase = ''
mkdir -p $out/share/mpv/scripts
cp -r 360plugin.lua $out/share/mpv/scripts/
'';
passthru.scriptName = "360plugin.lua";
meta = with lib; {
description = "Script for mpv to play VR video with optional saving of head tracking data";
homepage = "https://github.com/dfaker/VR-reversal";
license = licenses.unlicense;
platforms = platforms.all;
maintainers = with maintainers; [ schnusch ];
};
}

View File

@@ -0,0 +1,108 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
gitUpdater,
nodejs,
cmake,
pkg-config,
openssl,
libdatachannel,
plog,
}:
let
# Modified from pkgs/by-name/ht/httptoolkit-server/package.nix
nodeDatachannel = buildNpmPackage {
pname = "node-datachannel";
version = "0.10.1";
src = fetchFromGitHub {
owner = "murat-dogan";
repo = "node-datachannel";
rev = "refs/tags/v${nodeDatachannel.version}";
hash = "sha256-r5tBg645ikIWm+RU7Muw/JYyd7AMpkImD0Xygtm1MUk=";
};
npmFlags = [ "--ignore-scripts" ];
makeCacheWritable = true;
npmDepsHash = "sha256-1ZJd0Y45B3CT2YPXDYfCuFMBo5uggWRuDH11eCobyyY=";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
openssl
libdatachannel
plog
];
dontUseCmakeConfigure = true;
env.NIX_CFLAGS_COMPILE = "-I${nodejs}/include/node";
preBuild = ''
# don't use static libs and don't use FetchContent
substituteInPlace CMakeLists.txt \
--replace-fail 'OPENSSL_USE_STATIC_LIBS TRUE' 'OPENSSL_USE_STATIC_LIBS FALSE' \
--replace-fail 'if(NOT libdatachannel)' 'if(false)' \
--replace-fail 'datachannel-static' 'datachannel'
sed -i '2ifind_package(plog)' CMakeLists.txt
# don't fetch node headers
substituteInPlace node_modules/cmake-js/lib/dist.js \
--replace-fail '!this.downloaded' 'false'
'';
installPhase = ''
runHook preInstall
install -Dm755 build/Release/*.node -t $out/build/Release
runHook postInstall
'';
};
in
buildNpmPackage rec {
pname = "webtorrent-mpv-hook";
version = "1.4.4";
src = fetchFromGitHub {
owner = "mrxdst";
repo = "webtorrent-mpv-hook";
rev = "v${version}";
hash = "sha256-qFeQBVPZZFKkxz1fhK3+ah3TPDovklhhQwtv09TiSqo=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
postPatch = ''
substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${lib.getExe nodejs}'"
# This executable is just for telling non-Nix users how to install
substituteInPlace package.json --replace-fail '"bin": "build/bin.mjs",' ""
rm -rf src/bin.ts
'';
npmDepsHash = "sha256-fKzXdbtxC2+63/GZdvPOxvBpQ5rzgvfseigOgpP1n5I=";
makeCacheWritable = true;
npmFlags = [ "--ignore-scripts" ];
postConfigure = ''
# manually place our prebuilt `node-datachannel` binary into its place, since we used '--ignore-scripts'
ln -s ${nodeDatachannel}/build node_modules/node-datachannel/build
'';
postInstall = ''
mkdir -p $out/share/mpv/scripts/
ln -s $out/lib/node_modules/webtorrent-mpv-hook/build/webtorrent.js $out/share/mpv/scripts/
'';
passthru.scriptName = "webtorrent.js";
meta = {
description = "Adds a hook that allows mpv to stream torrents";
homepage = "https://github.com/mrxdst/webtorrent-mpv-hook";
maintainers = [ lib.maintainers.chuangzhu ];
license = lib.licenses.isc;
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildLua,
fetchFromGitHub,
yt-dlp,
}:
buildLua {
pname = "youtube-chat";
version = "unstable-2024-06-08";
src = fetchFromGitHub {
owner = "BanchouBoo";
repo = "mpv-youtube-chat";
rev = "4b8d6d5d3ace40d467bc0ed75f3af2a1aefce161";
hash = "sha256-uZC7iDYqLUuXnqSLke4j6rLoufc/vFTE6Ehnpu//dxY=";
};
scriptPath = "youtube-chat";
installPhase = ''
runHook preInstall
install -D -t $out/share/mpv/scripts/youtube-chat main.lua
runHook postInstall
'';
passthru.extraWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ yt-dlp ])
];
meta = {
description = "MPV script to overlay youtube chat on top of a video using yt-dlp";
homepage = "https://github.com/BanchouBoo/mpv-youtube-chat";
license = lib.licenses.mit;
platforms = yt-dlp.meta.platforms;
maintainers = with lib.maintainers; [ fliegendewurst ];
};
}

View File

@@ -0,0 +1,33 @@
{
buildLua,
fetchFromGitHub,
curl,
unstableGitUpdater,
lib,
}:
buildLua rec {
pname = "youtube-upnext";
version = "1.1";
src = fetchFromGitHub {
owner = "cvzi";
repo = "mpv-youtube-upnext";
rev = "v${version}";
hash = "sha256-x9mfyc8JIlOpbSfGEwxXoUtsH0A+K3JPwT/8MHq7ks4=";
};
postPatch = ''
substituteInPlace youtube-upnext.lua \
--replace-fail '"curl"' '"${lib.getExe curl}"'
'';
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Userscript that allows you to play 'up next'/recommended youtube videos";
homepage = "https://github.com/cvzi/mpv-youtube-upnext";
maintainers = with maintainers; [ bddvlpr ];
license = licenses.unfree;
};
}