diff options
author | tdro <tdro@users.noreply.github.com> | 2020-12-05 01:44:19 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2020-12-05 01:44:19 -0500 |
commit | ea0d4733ad73f3e0d4d00fa1d18c3dfa1935e70e (patch) | |
tree | 0f85de318feae5b75a33998b274b4a2d6bad00c9 /.config | |
parent | 0ab75965d21472c09d2512b53803123117a72df8 (diff) | |
download | dotfiles-ea0d4733ad73f3e0d4d00fa1d18c3dfa1935e70e.tar.gz dotfiles-ea0d4733ad73f3e0d4d00fa1d18c3dfa1935e70e.tar.bz2 dotfiles-ea0d4733ad73f3e0d4d00fa1d18c3dfa1935e70e.zip |
.config/nixpkgs: Assume control over youtube-dl
It's a fast moving target.
Diffstat (limited to '.config')
-rw-r--r-- | .config/nixpkgs/config.nix | 2 | ||||
-rw-r--r-- | .config/nixpkgs/packages/youtube-dl/default.nix | 56 |
2 files changed, 57 insertions, 1 deletions
diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix index 552fcf5..684eba2 100644 --- a/.config/nixpkgs/config.nix +++ b/.config/nixpkgs/config.nix @@ -21,6 +21,7 @@ in (callPackage ./packages/chromexup/default.nix {}) (callPackage ./packages/systemd2nix/default.nix {}) (callPackage ./packages/vale-styles/default.nix {}) + (callPackage ./packages/youtube-dl/default.nix {}) (pass.withExtensions (ext: with ext; [ pass-audit pass-import pass-otp ])) unstable.fzf unstable.hugo @@ -85,7 +86,6 @@ in wavemon weechat xdg-user-dirs - youtube-dl zbar ]; pathsToLink = [ "/etc" "/share" "/bin" ]; diff --git a/.config/nixpkgs/packages/youtube-dl/default.nix b/.config/nixpkgs/packages/youtube-dl/default.nix new file mode 100644 index 0000000..3dc4a27 --- /dev/null +++ b/.config/nixpkgs/packages/youtube-dl/default.nix @@ -0,0 +1,56 @@ +{ python38Packages, lib, fetchurl, zip, ffmpeg, rtmpdump, phantomjs2 +, atomicparsley, pandoc, generateManPage ? true, ffmpegSupport ? true +, rtmpSupport ? true, phantomjsSupport ? false, hlsEncryptedSupport ? true +, installShellFiles, makeWrapper }: + +python38Packages.buildPythonPackage rec { + + pname = "youtube-dl"; + version = "2020.12.05"; + + src = fetchurl { + url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz"; + sha256 = "065s45l8qz7wlkaxw9bj20gq9647zpwdj9vc6chhqjscl63z1aqm"; + }; + + nativeBuildInputs = [ installShellFiles makeWrapper ]; + buildInputs = [ zip ] ++ lib.optional generateManPage pandoc; + propagatedBuildInputs = + lib.optional hlsEncryptedSupport python38Packages.pycryptodome; + + makeWrapperArgs = let + packagesToBinPath = [ atomicparsley ] ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional rtmpSupport rtmpdump + ++ lib.optional phantomjsSupport phantomjs2; + in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; + + setupPyBuildFlags = [ "build_lazy_extractors" ]; + + postInstall = '' + installShellCompletion youtube-dl.zsh + ''; + + doCheck = false; + + meta = with lib; { + homepage = "https://ytdl-org.github.io/youtube-dl/"; + description = + "Command-line tool to download videos from YouTube.com and other sites"; + longDescription = '' + youtube-dl is a small, Python-based command-line program + to download videos from YouTube.com and a few more sites. + youtube-dl is released to the public domain, which means + you can modify it, redistribute it or use it however you like. + ''; + license = licenses.publicDomain; + platforms = with platforms; linux ++ darwin; + maintainers = with maintainers; [ + bluescreen303 + phreedom + AndersonTorres + fpletz + enzime + ma27 + ]; + }; +} |