nixpkgs/pkgs/applications/video/mpv/scripts/mpvacious.nix
2024-03-13 06:43:49 +00:00

47 lines
1.1 KiB
Nix

{ lib
, buildLua
, fetchFromGitHub
, gitUpdater
, curl
, wl-clipboard
, xclip
}:
buildLua rec {
pname = "mpvacious";
version = "0.27";
src = fetchFromGitHub {
owner = "Ajatt-Tools";
repo = "mpvacious";
rev = "v${version}";
sha256 = "sha256-pn6hNEhOzKiU+zQJKj/rF0GLXaEe+XBpHp0RlzsNIio=";
};
passthru.updateScript = gitUpdater {
rev-prefix = "v";
};
postPatch = ''
substituteInPlace utils/forvo.lua \
--replace "'curl" "'${curl}/bin/curl"
substituteInPlace platform/nix.lua \
--replace "'curl" "'${curl}/bin/curl" \
--replace "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \
--replace "'xclip" "'${xclip}/bin/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 ];
};
}