From 39bc3119b891ca3fcc498e9431eb3159bddc4573 Mon Sep 17 00:00:00 2001 From: octvs Date: Fri, 15 Nov 2024 12:50:49 +0100 Subject: [PATCH] mpvScripts.autosub: init at 2021-06-29 --- .../video/mpv/scripts/autosub.nix | 33 +++++++++++++++++++ .../video/mpv/scripts/default.nix | 1 + 2 files changed, 34 insertions(+) create mode 100644 pkgs/applications/video/mpv/scripts/autosub.nix diff --git a/pkgs/applications/video/mpv/scripts/autosub.nix b/pkgs/applications/video/mpv/scripts/autosub.nix new file mode 100644 index 0000000000000..e41ac3e5285e5 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/autosub.nix @@ -0,0 +1,33 @@ +{ + lib, + buildLua, + fetchFromGitHub, + python3, +}: +buildLua { + pname = "mpv-autosub"; + version = "0-unstable-2021-06-29"; + scriptPath = "autosub.lua"; + + src = fetchFromGitHub { + owner = "davidde"; + repo = "mpv-autosub"; + rev = "35115355bd339681f97d067538356c29e5b14afa"; + hash = "sha256-BKT/Tzwl5ZA4fbdc/cxz0+CYc1zyY/KOXc58x5GYow0="; + }; + + # passthru.updateScript = unstableGitUpdater {}; + + preInstall = '' + substituteInPlace autosub.lua --replace-fail \ + "local subliminal = '/home/david/.local/bin/subliminal'" \ + "local subliminal = '${python3.pkgs.subliminal}/bin/subliminal'" + ''; + + meta = { + description = "Fully automatic subtitle downloading for the MPV media player"; + homepage = "https://github.com/davidde/mpv-autosub"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.octvs ]; + }; +} diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 4947bf7a4dd1d..f4bbc934481ce 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -98,6 +98,7 @@ let ; buildLua = callPackage ./buildLua.nix { }; + autosub = callPackage ./autosub.nix { }; autosubsync-mpv = callPackage ./autosubsync-mpv.nix { }; chapterskip = callPackage ./chapterskip.nix { }; convert = callPackage ./convert.nix { };