mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 08:59:32 +03:00
40e2f9fb03
Prevent ytfzf from installing its own updates. Add all programs that are possibly used in the script to $PATH. A 10M increase in closure size seems very acceptable.
52 lines
1009 B
Nix
52 lines
1009 B
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, makeWrapper
|
|
, coreutils
|
|
, curl
|
|
, dmenu
|
|
, fzf
|
|
, gnused
|
|
, jq
|
|
, mpv
|
|
, ncurses
|
|
, ueberzug
|
|
, youtube-dl
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "ytfzf";
|
|
version = "1.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pystardust";
|
|
repo = "ytfzf";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-ATQRXYaIp1MKCO/EAPsopzFEZeNJzdk73/OcgjsMdkg=";
|
|
};
|
|
|
|
patches = [
|
|
# Updates have to be installed through Nix.
|
|
./no-update.patch
|
|
];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}/bin" ];
|
|
|
|
dontBuild = true;
|
|
|
|
postInstall = ''
|
|
wrapProgram "$out/bin/ytfzf" --prefix PATH : ${lib.makeBinPath [
|
|
coreutils curl dmenu fzf gnused jq mpv ncurses ueberzug youtube-dl
|
|
]}
|
|
'';
|
|
|
|
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 ];
|
|
};
|
|
}
|