1 { lib, buildLua, fetchFromGitHub, makeWrapper, unstableGitUpdater }:
4 pname = "video-cutter";
5 version = "unstable-2023-11-09";
7 src = fetchFromGitHub {
9 repo = "mpv-video-cutter";
10 rev = "01a0396c075d5f8bbd1de5b571e6231f8899ab65";
11 sha256 = "sha256-veoRFzUCRH8TrvR7x+WWoycpDyxqrJZ/bnp61dVc0pE=";
13 passthru.updateScript = unstableGitUpdater {};
15 nativeBuildInputs = [ makeWrapper ];
18 substituteInPlace cutter.lua \
19 --replace '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
21 # needs to be ran separately so that we can replace everything, and not every single mention explicitly
22 # original script places them in the scripts folder, just spawning unnecessary errors
23 # i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream
24 substituteInPlace cutter.lua \
25 --replace '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
28 passthru.scriptName = "cutter.lua";
29 extraScripts = [ "c_concat.sh" ];
32 chmod 0755 $out/share/mpv/scripts/c_concat.sh
33 wrapProgram $out/share/mpv/scripts/c_concat.sh \
34 --run "mkdir -p ~/.config/mpv/cutter/"
38 description = "Cut videos and concat them automatically";
39 homepage = "https://github.com/rushmj/mpv-video-cutter";
40 license = licenses.mit;
41 maintainers = with maintainers; [ lom ];