about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/scripts/thumbnail.nix
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2021-03-10 14:23:24 -0500
committerfigsoda <figsoda@pm.me>2021-03-10 14:23:24 -0500
commit6fe976fde218948cd01014d1bf05dc2ec282428c (patch)
tree7bb875f3cacc7c41c60383d6662c0a43630ca256 /pkgs/applications/video/mpv/scripts/thumbnail.nix
parent60da0e95948af2b8632b9097e64d547904ad0987 (diff)
mpvScripts.thumbnail: init at unstable-2020-01-16
Diffstat (limited to 'pkgs/applications/video/mpv/scripts/thumbnail.nix')
-rw-r--r--pkgs/applications/video/mpv/scripts/thumbnail.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/thumbnail.nix b/pkgs/applications/video/mpv/scripts/thumbnail.nix
new file mode 100644
index 0000000000000..cda15b2674c04
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/thumbnail.nix
@@ -0,0 +1,36 @@
+{ fetchFromGitHub, lib, python3, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "mpv_thumbnail_script";
+  version = "unstable-2020-01-16";
+
+  src = fetchFromGitHub {
+    owner = "theamm";
+    repo = pname;
+    rev = "682becf5b5115c2a206b4f0bdee413d4be8b5bef";
+    sha256 = "0dgfrb8ypc5vlq35kzn423fm6l6348ivl85vb6j3ccc9a51xprw3";
+  };
+
+  nativeBuildInputs = [ python3 ];
+
+  postPatch = ''
+    patchShebangs concat_files.py
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/mpv/scripts
+    cp mpv_thumbnail_script_{client_osc,server}.lua $out/share/mpv/scripts
+    runHook postInstall
+  '';
+
+  passthru.scriptName = "mpv_thumbnail_script_{client_osc,server}.lua";
+
+  meta = with lib; {
+    description = "A lua script to show preview thumbnails in mpv's OSC seekbar";
+    homepage = "https://github.com/theamm/mpv_thumbnail_script";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}