12 inherit (lib.strings) match stringAsChars toLower;
13 isUpper = match "[A-Z]";
15 stringAsChars (c: if isUpper c != null then "-${toLower c}" else c);
21 pname = camelToKebab name;
22 version = "0-unstable-2024-01-11";
23 src = fetchFromGitHub {
26 rev = "d0390c8e802c2e888ff4a2e1d5e4fb040f855b89";
27 hash = "sha256-pc2aaO7lZaoYMEXv5M0WI7PtmqgkNbdtNiLZZwVzppM=";
29 passthru.updateScript = unstableGitUpdater { };
31 scriptPath = "scripts/${pname}.lua";
34 homepage = "https://github.com/occivink/mpv-scripts";
35 license = licenses.unlicense;
36 maintainers = with maintainers; [ nicoo ];
39 # Sadly needed to make `common-updaters` work here
40 pos = builtins.unsafeGetAttrPos "version" self;
43 buildLua (lib.attrsets.recursiveUpdate self args);
45 lib.recurseIntoAttrs (
46 lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
48 # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
49 crop.meta.description = "Crop the current video in a visual manner";
50 seekTo.meta.description = "Mpv script for seeking to a specific position";
51 blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension";
54 meta.description = "Make an extract of the video currently playing using ffmpeg";
57 substituteInPlace scripts/encode.lua \
58 --replace-fail '"ffmpeg"' '"${lib.getExe ffmpeg}"'