monitorcontrol: 4.2.0 → 4.3.3 (#375061)
[NixPkgs.git] / pkgs / applications / video / mpv / scripts / mpv-discord.nix
blob58d4940f548b68ebf68d9a1d1c93cf1722a04081
2   fetchFromGitHub,
3   buildGoModule,
4   buildLua,
5   lib,
6 }:
7 let
8   version = "1.6.1";
10   src = fetchFromGitHub {
11     owner = "tnychn";
12     repo = "mpv-discord";
13     rev = "v${version}";
14     hash = "sha256-P1UaXGboOiqrXapfLzJI6IT3esNtflkQkcNXt4Umukc=";
15   };
17   core = buildGoModule {
18     name = "mpv-discord-core";
19     inherit version;
21     src = "${src}/mpv-discord";
23     vendorHash = "sha256-xe1jyWFQUD+Z4qBAVQ0SBY0gdxmi5XG9t29n3f/WKDs=";
24   };
26 buildLua {
27   pname = "mpv-discord";
28   inherit version src;
30   scriptPath = "scripts/discord.lua";
32   postInstall = ''
33     substituteInPlace $out/share/mpv/scripts/discord.lua \
34       --replace-fail 'binary_path = ""' 'binary_path = "${core}/bin/mpv-discord"'
35   '';
37   meta = {
38     description = "Cross-platform Discord Rich Presence integration for mpv with no external dependencies";
39     homepage = "https://github.com/tnychn/mpv-discord";
40     license = lib.licenses.mit;
41     platforms = lib.platforms.all;
42     maintainers = with lib.maintainers; [ bddvlpr ];
43   };