Skip to content

Commit

Permalink
mpvScripts.autosubsync: init at unstable-2022-12-16 (NixOS#226938)
Browse files Browse the repository at this point in the history
  • Loading branch information
KoviRobi authored May 29, 2024
1 parent e6154cf commit 6684eb5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions pkgs/applications/video/mpv/scripts/autosubsync-mpv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
buildLua,
alass,
}:

buildLua {
pname = "autosubsync-mpv";
version = "0-unstable-2022-12-26";

src = fetchFromGitHub {
owner = "joaquintorres";
repo = "autosubsync-mpv";
rev = "22cb928ecd94cc8cadaf8c354438123c43e0c70d";
sha256 = "sha256-XQPFC7l9MTZAW5FfULRQJfu/7FuGj9bbjQUZhNv0rlc=";
};

# While nixpkgs only packages alass, we might as well make that the default
patchPhase = ''
runHook prePatch
substituteInPlace autosubsync.lua \
--replace-warn 'alass_path = ""' 'alass_path = "${alass}/bin/alass-cli"' \
--replace-warn 'audio_subsync_tool = "ask"' 'audio_subsync_tool = "alass"' \
--replace-warn 'altsub_subsync_tool = "ask"' 'altsub_subsync_tool = "alass"'
runHook postPatch
'';

scriptPath = "./";
passthru.scriptName = "autosubsync-mpv";

meta = with lib; {
description = "Automatically sync subtitles in mpv using the `n` button";
homepage = "https://github.com/joaquintorres/autosubsync-mpv";
maintainers = with maintainers; [ kovirobi ];
license = licenses.mit;
};
}
1 change: 1 addition & 0 deletions pkgs/applications/video/mpv/scripts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ let
inherit (callPackage ./occivink.nix { }) blacklistExtensions seekTo;

buildLua = callPackage ./buildLua.nix { };
autosubsync-mpv = callPackage ./autosubsync-mpv.nix { };
chapterskip = callPackage ./chapterskip.nix { };
convert = callPackage ./convert.nix { };
cutter = callPackage ./cutter.nix { };
Expand Down

0 comments on commit 6684eb5

Please sign in to comment.