nix/module/common/ytdlp/default.nix

30 lines
712 B
Nix
Raw Normal View History

2024-03-14 13:24:49 +03:00
{ lib, stdenv, fetchurl, autoPatchelfHook }: let
2024-04-26 15:12:41 +03:00
version = "2024.04.09";
hash = "sha256-agT93DYJ0ic2w5ojumGRMzJomt6DgIkqrIRvTO11PHs=";
2024-03-14 13:24:49 +03:00
in stdenv.mkDerivation {
name = "ytdlp";
dontUnpack = true;
2024-03-14 14:36:20 +03:00
# https://github.com/yt-dlp/yt-dlp
2024-03-14 13:24:49 +03:00
src = fetchurl {
url = "https://github.com/yt-dlp/yt-dlp/releases/download/${version}/yt-dlp_linux";
sha256 = "${hash}";
};
nativeBuildInputs = [ autoPatchelfHook ];
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/yt-dlp
chmod +x $out/bin/yt-dlp
'';
meta = with lib; {
description = "Youtube Downloader.";
homepage = "https://github.com/yt-dlp/yt-dlp";
license = licenses.unlicense;
meta.platforms = platforms.all;
};
}