From 80f7a889ec92ead5357cb354087a630c7465ea47 Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Sun, 8 Jun 2025 20:37:32 +0800 Subject: [PATCH] mpv-handler: init at 0.3.16 --- pkgs/by-name/mp/mpv-handler/package.nix | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkgs/by-name/mp/mpv-handler/package.nix diff --git a/pkgs/by-name/mp/mpv-handler/package.nix b/pkgs/by-name/mp/mpv-handler/package.nix new file mode 100644 index 000000000000..389c9bb96357 --- /dev/null +++ b/pkgs/by-name/mp/mpv-handler/package.nix @@ -0,0 +1,50 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + makeWrapper, + mpv, + yt-dlp, + nix-update-script, +}: +rustPlatform.buildRustPackage rec { + pname = "mpv-handler"; + version = "0.3.16"; + + src = fetchFromGitHub { + owner = "akiirui"; + repo = "mpv-handler"; + tag = "v${version}"; + hash = "sha256-RpfHUVZmhtneeu8PIfxinYG3/groJPA9QveDSvzU6Zo="; + }; + + cargoHash = "sha256-FrE1PSRc7GTNUum05jNgKnzpDUc3FiS5CEM18It0lYY="; + useFetchCargoVendor = true; + + passthru.updateScript = nix-update-script { }; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + install -Dm644 share/linux/mpv-handler.desktop -t $out/share/applications/ + install -Dm644 share/linux/mpv-handler-debug.desktop -t $out/share/applications/ + install -Dm644 share/linux/config.toml -t $out/share/doc/mpv-handler/ + + wrapProgram $out/bin/mpv-handler \ + --prefix PATH : ${ + lib.makeBinPath [ + mpv + yt-dlp + ] + } + ''; + + meta = { + description = "Play website videos and songs with mpv & yt-dlp"; + homepage = "https://github.com/akiirui/mpv-handler"; + mainProgram = "mpv-handler"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ lonerOrz ]; + platforms = lib.platforms.linux; + }; +}