summary refs log tree commit diff
path: root/pkgs/applications/audio/jmusicbot/default.nix
blob: 299fe547366a63de748c31938c8c661b33c438d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ stdenv, lib, fetchurl, makeWrapper, jre }:

stdenv.mkDerivation rec {
  pname = "JMusicBot";
  version = "0.3.4";

  src = fetchurl {
    url = "https://github.com/jagrosh/MusicBot/releases/download/${version}/JMusicBot-${version}.jar";
    sha256 = "sha256-++/ot9k74pkN9Wl7IEjiMIv/q5zklIEdU6uFjam0tmU=";
  };

  dontUnpack = true;

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir -p $out/lib
    cp $src $out/lib/JMusicBot

    makeWrapper ${jre}/bin/java $out/bin/JMusicBot \
      --add-flags "-Xmx1G -Dnogui=true -jar $out/lib/JMusicBot"
  '';

  meta = with lib; {
    description = "Discord music bot that's easy to set up and run yourself";
    homepage = "https://github.com/jagrosh/MusicBot";
    license = licenses.asl20;
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.all;
  };
}