about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBatteredBunny <ayes2022@protonmail.com>2024-05-01 17:34:42 +0300
committerGitHub <noreply@github.com>2024-05-01 14:34:42 +0000
commit1e7f2da6b00e81a3808f348d57879155d5a748ab (patch)
tree93113fa96e1535f18bebfd0f92f6b321a598f632
parentc88ff41a3703958bd344693f9495caf9567f9687 (diff)
mpvScripts.videoclip: init at 0-unstable-2024-03-08 (#269272)
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix1
-rw-r--r--pkgs/applications/video/mpv/scripts/videoclip.nix40
2 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index 6fb7f19f20bb6..8b740d1ded325 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -89,6 +89,7 @@ let
     thumbfast = callPackage ./thumbfast.nix { };
     thumbnail = callPackage ./thumbnail.nix { };
     uosc = callPackage ./uosc.nix { };
+    videoclip = callPackage ./videoclip.nix { };
     visualizer = callPackage ./visualizer.nix { };
     vr-reversal = callPackage ./vr-reversal.nix { };
     webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
diff --git a/pkgs/applications/video/mpv/scripts/videoclip.nix b/pkgs/applications/video/mpv/scripts/videoclip.nix
new file mode 100644
index 0000000000000..fff5b788b0286
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/videoclip.nix
@@ -0,0 +1,40 @@
+{ lib
+, fetchFromGitHub
+, curl
+, xclip
+, wl-clipboard
+, stdenv
+, buildLua
+, unstableGitUpdater
+}:
+buildLua {
+  pname = "videoclip";
+  version = "0-unstable-2024-03-08";
+
+  src = fetchFromGitHub {
+    owner = "Ajatt-Tools";
+    repo = "videoclip";
+    rev = "0e3f2245b03e888c14c093a50261e0f54ecdf8e8";
+    hash = "sha256-Sg6LHU9OVmVx3cTs8Y0WL8wACb5BlVyeBRccoX+7BXY=";
+  };
+
+  patchPhase = ''
+    substituteInPlace platform.lua \
+    --replace \'curl\' \'${lib.getExe curl}\' \
+  '' + lib.optionalString stdenv.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 ];
+  };
+}