@@ -0,0 +1,47 @@
1+{ lib
2+, stdenv
3+, fetchFromGitHub
4+, makeWrapper
5+, curl
6+, dmenu
7+, fzf
8+, jq
9+, mpv
10+, youtube-dl
11+}:
12+
13+stdenv.mkDerivation rec {
14+ pname = "ytfzf";
15+ version = "1.0.0";
16+
17+ src = fetchFromGitHub {
18+ owner = "pystardust";
19+ repo = "ytfzf";
20+ rev = "v${version}";
21+ sha256 = "09znixn8mpkxipv2x3nrfxr2i8g7y58v25qssqf092j9lh85sf9h";
22+ };
23+
24+ nativeBuildInputs = [ makeWrapper ];
25+
26+ makeFlags = [ "PREFIX=${placeholder "out"}" ];
27+
28+ dontBuild = true;
29+
30+ # remove after next update
31+ preInstall = ''
32+ mkdir -p "$out/bin"
33+ '';
34+
35+ postInstall = ''
36+ wrapProgram "$out/bin/ytfzf" --prefix PATH : ${lib.makeBinPath [
37+ curl dmenu fzf jq mpv youtube-dl
38+ ]}
39+ '';
40+
41+ meta = with lib; {
42+ description = "A posix script to find and watch youtube videos from the terminal";
43+ homepage = "https://github.com/pystardust/ytfzf";
44+ license = licenses.gpl3Only;
45+ maintainers = with maintainers; [ dotlambda ];
46+ };
47+}