1{
2 lib,
3 fetchFromGitHub,
4 unstableGitUpdater,
5 buildLua,
6 xclip,
7}:
8
9let
10 mkScript =
11 pname: args:
12 let
13 self = {
14 inherit pname;
15 version = "25-09-2023-unstable-2025-06-21";
16
17 src = fetchFromGitHub {
18 owner = "Eisa01";
19 repo = "mpv-scripts";
20 rev = "b9e63743a858766c9cc7a801d77313b0cecdb049";
21 hash = "sha256-ohUZH6m+5Sk3VKi9qqEgwhgn2DMOFIvvC41pMkV6oPw=";
22 # avoid downloading screenshots and videos
23 sparseCheckout = [
24 "scripts/"
25 "script-opts/"
26 ];
27 };
28 passthru.updateScript = unstableGitUpdater { };
29
30 meta = with lib; {
31 homepage = "https://github.com/Eisa01/mpv-scripts";
32 license = licenses.bsd2;
33 };
34
35 # Sadly needed to make `common-updaters` work here
36 pos = builtins.unsafeGetAttrPos "version" self;
37 };
38 in
39 buildLua (lib.attrsets.recursiveUpdate self args);
40in
41lib.recurseIntoAttrs (
42 lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
43
44 # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
45 smart-copy-paste-2 = {
46 scriptPath = "scripts/SmartCopyPaste_II.lua";
47 prePatch = ''
48 substituteInPlace $scriptPath --replace-fail 'xclip' "${lib.getExe xclip}"
49 '';
50
51 meta = {
52 description = "Smart copy paste with logging and clipboard support";
53 maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
54 };
55 };
56
57 simplebookmark = {
58 scriptPath = "scripts/SimpleBookmark.lua";
59 meta = {
60 description = "Simple bookmarks script based on assigning keys";
61 maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
62 };
63 };
64
65 simplehistory = {
66 scriptPath = "scripts/SimpleHistory.lua";
67 meta = {
68 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";
69 maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
70 };
71 };
72
73 smartskip = {
74 scriptPath = "scripts/SmartSkip.lua";
75 meta = {
76 description = "Automatically or manually skip opening, intro, outro, and preview";
77 maintainers = with lib.maintainers; [ iynaix ];
78 };
79 };
80
81 undoredo = {
82 scriptPath = "scripts/UndoRedo.lua";
83 meta = {
84 description = "Undo / redo any accidental time jumps";
85 maintainers = with lib.maintainers; [ iynaix ];
86 };
87 };
88 }
89)