1
0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-11-26 06:08:48 +01:00

swap jmusicbot to gmusicbot

This commit is contained in:
Jill "oatmealine" Monoids 2023-06-22 11:15:08 +02:00
parent 623d4040a5
commit b99c047395
4 changed files with 85 additions and 3 deletions

@ -192,13 +192,15 @@ in {
forceskip = [ "fs" ];
movetrack = [ "move" "m" ];
};
queuetype = "REGULAR";
};
in {
enable = true;
instances = {
"jomble" = {
enable = true;
package = pkgs.unstable.jmusicbot;
package = pkgs._.gmusicbot;
options = baseOptions // {
token = lib.removeSuffix "\n" (builtins.readFile /etc/jomble_token);
@ -207,7 +209,7 @@ in {
};
"jillo" = {
enable = true;
package = pkgs.unstable.jmusicbot;
package = pkgs._.gmusicbot;
options = baseOptions // {
token = lib.removeSuffix "\n" (builtins.readFile /etc/jillo_token);

@ -270,6 +270,16 @@ in {
};
};
queuetype = mkOption {
type = types.enum ["FAIR" "REGULAR"];
description = ''
Sets the queue type
FAIR: Each user gets a fair chance at the queue by rearranging it such that no user can fill it up entirely
REGULAR: Queue works as first-come, first-served
'';
default = "FAIR";
};
eval = mkOption {
type = types.bool;
description = ''
@ -359,4 +369,4 @@ in {
}
) cfg.instances;
};
}
}

@ -0,0 +1,38 @@
{ lib, pkgs }:
let
shade_1_5 = map (obj: pkgs.javaPackages.fetchMaven {
version = "1.5";
artifactId = "maven-shade-plugin";
groupId = "org.apache.maven.plugins";
sha512 = obj.sha512;
type = obj.type;
}) [
{ type = "jar"; sha512 = "sha512-AoBtMzmqWMiOz5CSzl6ucYXK2iPtYbSlbsa2f8gCeP9ZtZfM+LkrEVzF9JcWsn+qbA9zC84O0fUyt7fJl8ZrBg=="; }
{ type = "pom"; sha512 = "sha512-YJTFhsAs3hV26L0+fAStwY6AHnPx6+cCo6yP/ZJTOUZvrlNTA1qxP/aBYjhPX3IvQ+UhagwdrSbA4uIS3w5sUw=="; }
];
in pkgs.javaPackages.mavenbuild rec {
version = "2023-05-19";
name = "gmusicbot-${version}";
mavenDeps = [
shade_1_5
];
m2Path = "/jmusicbot/jmusicbot/${version}";
src = pkgs.fetchFromGitea {
domain = "git.oat.zone";
owner = "oat";
repo = "GMusicBot";
rev = "master";
sha256 = "sha256-+sH5LI7PUN25rR1DM529Ly0WPHB4/JIQAPxWi0IlsZ4=";
};
meta = with pkgs.lib; {
description = "Discord music bot that's easy to set up and run yourself";
homepage = "https://git.oat.zone/oat/GMusicBot";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
inherit (pkgs.jre_headless.meta) platforms;
};
}

32
packages/gmusicbot.nix Normal file

@ -0,0 +1,32 @@
{ stdenv, lib, fetchurl, makeWrapper, jre_headless }:
stdenv.mkDerivation rec {
pname = "GMusicBot";
version = "2023-05-19";
src = fetchurl {
url = "https://oat.zone/f/GMusicBot-2023-05-19.jar?v=3";
sha256 = "sha256-5c36did0kkaeu4Yi9vGIhlqRoeUBBRWKdihbaW9lwk4=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/lib
cp $src $out/lib/GMusicBot
makeWrapper ${jre_headless}/bin/java $out/bin/GMusicBot \
--add-flags "-Xmx1G -Dnogui=true -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -jar $out/lib/GMusicBot"
'';
meta = with lib; {
description = "Discord music bot that's easy to set up and run yourself";
homepage = "https://git.oat.zone/oat/GMusicBot";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
maintainers = with maintainers; [ SuperSandro2000 ];
inherit (jre_headless.meta) platforms;
};
}