2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2022-01-03 16:56:52 +00:00
|
|
|
, chafa
|
2021-03-15 08:37:03 +00:00
|
|
|
, coreutils
|
2021-03-09 03:18:52 +00:00
|
|
|
, curl
|
|
|
|
, dmenu
|
|
|
|
, fzf
|
2021-03-15 08:37:03 +00:00
|
|
|
, gnused
|
2021-03-09 03:18:52 +00:00
|
|
|
, jq
|
|
|
|
, mpv
|
2021-03-15 08:37:03 +00:00
|
|
|
, ueberzug
|
2022-01-03 16:56:52 +00:00
|
|
|
, yt-dlp
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ytfzf";
|
2022-01-03 16:56:52 +00:00
|
|
|
version = "2.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pystardust";
|
|
|
|
repo = "ytfzf";
|
|
|
|
rev = "v${version}";
|
2022-01-03 16:56:52 +00:00
|
|
|
sha256 = "sha256-JuLfFC3oz2FvCaD+XPuL1N8tGKmv4atyZIBeDKWYgT8=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}/bin" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/ytfzf" --prefix PATH : ${lib.makeBinPath [
|
2022-01-03 16:56:52 +00:00
|
|
|
chafa coreutils curl dmenu fzf gnused jq mpv ueberzug yt-dlp
|
2021-03-09 03:18:52 +00:00
|
|
|
]}
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
gzip -c docs/man/ytfzf.1 > docs/man/ytfzf.1.gz
|
|
|
|
gzip -c docs/man/ytfzf.5 > docs/man/ytfzf.5.gz
|
|
|
|
install -Dt "$out/share/man/man1" docs/man/ytfzf.1.gz
|
|
|
|
install -Dt "$out/share/man/man5" docs/man/ytfzf.5.gz
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A posix script to find and watch youtube videos from the terminal";
|
|
|
|
homepage = "https://github.com/pystardust/ytfzf";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|