mpvScripts.mpv-discord: init at 1.6.1 (#336301)

This commit is contained in:
Artturin 2024-08-26 18:06:35 +03:00 committed by GitHub
commit 94930d463b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 0 deletions

View File

@ -111,6 +111,7 @@ let
modernx-zydezu = callPackage ./modernx-zydezu.nix { };
mpris = callPackage ./mpris.nix { };
mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
mpv-discord = callPackage ./mpv-discord.nix { };
mpv-notify-send = callPackage ./mpv-notify-send.nix { };
mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };

View File

@ -0,0 +1,44 @@
{
fetchFromGitHub,
buildGoModule,
buildLua,
lib,
}:
let
version = "1.6.1";
src = fetchFromGitHub {
owner = "tnychn";
repo = "mpv-discord";
rev = "v${version}";
hash = "sha256-P1UaXGboOiqrXapfLzJI6IT3esNtflkQkcNXt4Umukc=";
};
core = buildGoModule {
name = "mpv-discord-core";
inherit version;
src = "${src}/mpv-discord";
vendorHash = "sha256-xe1jyWFQUD+Z4qBAVQ0SBY0gdxmi5XG9t29n3f/WKDs=";
};
in
buildLua {
pname = "mpv-discord";
inherit version src;
scriptPath = "scripts/discord.lua";
postInstall = ''
substituteInPlace $out/share/mpv/scripts/discord.lua \
--replace-fail 'binary_path = ""' 'binary_path = "${core}/bin/mpv-discord"'
'';
meta = {
description = "Cross-platform Discord Rich Presence integration for mpv with no external dependencies";
homepage = "https://github.com/tnychn/mpv-discord";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ bddvlpr ];
};
}