YtDlp : Move to a separate package.

This commit is contained in:
Dmitry Voronin 2024-03-14 13:24:49 +03:00
parent 6db29f483c
commit 4693bced76
4 changed files with 35 additions and 1 deletions

View file

@ -133,6 +133,7 @@
./module/common/Tmux.nix ./module/common/Tmux.nix
./module/common/Users.nix ./module/common/Users.nix
./module/common/Wallpaper.nix ./module/common/Wallpaper.nix
./module/common/YtDlp.nix
]; ];
# Function to create a host. # Function to create a host.

View file

@ -45,7 +45,7 @@
wget wget
wine64 dxvk vkd3d wine64 dxvk vkd3d
wl-clipboard wl-clipboard
yt-dlp # yt-dlp
zip unzip zip unzip
]; ];

5
module/common/YtDlp.nix Normal file
View file

@ -0,0 +1,5 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
(pkgs.callPackage ./ytdlp {})
];
}

View file

@ -0,0 +1,28 @@
{ lib, stdenv, fetchurl, autoPatchelfHook }: let
version = "2024.03.10";
hash = "sha256-sYhSMRngpDaPU+Ea0PIjx+1EqKKGY+S2wgUSLaA39Hs=";
in stdenv.mkDerivation {
name = "ytdlp";
dontUnpack = true;
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;
};
}