1{
2 fetchFromGitHub,
3 makeWrapper,
4 stdenvNoCC,
5 lib,
6 gnugrep,
7 gnused,
8 curl,
9 catt,
10 syncplay,
11 ffmpeg,
12 fzf,
13 aria2,
14 mpv,
15 vlc,
16 iina,
17 withMpv ? true,
18 withVlc ? false,
19 withIina ? false,
20 chromecastSupport ? false,
21 syncSupport ? false,
22}:
23
24let
25 players = lib.optional withMpv mpv ++ lib.optional withVlc vlc ++ lib.optional withIina iina;
26in
27
28stdenvNoCC.mkDerivation (finalAttrs: {
29 pname = "ani-cli";
30 version = "4.10";
31
32 src = fetchFromGitHub {
33 owner = "pystardust";
34 repo = "ani-cli";
35 tag = "v${finalAttrs.version}";
36 hash = "sha256-R/YQ02ctTcAEzrVyWlaCHi1YW82iPrMBbbMNP21r0p8=";
37 };
38
39 nativeBuildInputs = [ makeWrapper ];
40 runtimeInputs = [
41 gnugrep
42 gnused
43 curl
44 fzf
45 ffmpeg
46 aria2
47 ]
48 ++ lib.optional chromecastSupport catt
49 ++ lib.optional syncSupport syncplay;
50
51 installPhase = ''
52 runHook preInstall
53
54 install -Dm755 ani-cli $out/bin/ani-cli
55
56 wrapProgram $out/bin/ani-cli \
57 --prefix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs} \
58 ${lib.optionalString (builtins.length players > 0) "--suffix PATH : ${lib.makeBinPath players}"}
59
60 runHook postInstall
61 '';
62
63 meta = {
64 homepage = "https://github.com/pystardust/ani-cli";
65 description = "Cli tool to browse and play anime";
66 license = lib.licenses.gpl3Plus;
67 maintainers = with lib.maintainers; [
68 skykanin
69 diniamo
70 ];
71 platforms = lib.platforms.unix;
72 mainProgram = "ani-cli";
73 };
74})