feat(minion): package and setup minion for eso

This commit is contained in:
Patrick 2024-08-07 18:37:21 +02:00
parent 4b732bcb84
commit f82c3ce165
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
4 changed files with 102 additions and 0 deletions

View file

@ -7,6 +7,7 @@
pr-tracker = final.callPackage ./pr-tracker.nix { };
homebox = final.callPackage ./homebox.nix { };
deploy = final.callPackage ./deploy.nix { };
minion = final.callPackage ./minion.nix { };
mongodb-bin = final.callPackage ./mongodb-bin.nix { };
awakened-poe-trade = final.callPackage ./awakened-poe-trade.nix { };
neovim-clean = final.neovim-unwrapped.overrideAttrs (

65
pkgs/minion.nix Normal file
View file

@ -0,0 +1,65 @@
{
stdenvNoCC,
lib,
fetchzip,
openjdk11,
makeDesktopItem,
javaPackages,
gsettings-desktop-schemas,
gtk3,
}:
let
openjfx = javaPackages.openjfx11.override { withWebKit = true; };
jdk = openjdk11.override (
prev:
prev
// {
enableJavaFX = true;
inherit openjfx;
}
);
in
stdenvNoCC.mkDerivation rec {
version = "3.0.12";
pname = "minion";
src = fetchzip {
url = "https://cdn.mmoui.com/minion/v3/Minion3.0.12-java.zip";
hash = "sha256-KjSj3TBMY3y5kgIywtIDeil0L17dau/Rb2HuXAulSO8=";
stripRoot = false;
};
installPhase = ''
mkdir -p "$out/bin"
mkdir -p "$out/lib/${pname}"
cp ./Minion-jfx.jar "$out/lib/${pname}/Minion-jfx.jar"
cp -r ./lib "$out/lib/${pname}/lib"
cat > "$out/bin/${pname}" << EOF
#!${stdenvNoCC.shell}
CLASSPATH="$out/lib"
XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:XDG_DATA_DIRS"
exec ${lib.getExe jdk} -cp "$CLASSPATH ./lib" -jar "$out/lib/${pname}/Minion-jfx.jar" "\$@"
EOF
chmod a+x "$out/bin/${pname}"
'';
desktopItems = [
(makeDesktopItem {
name = "minion";
exec = "minion";
comment = "MMO Addon manager for Elder Scrolls Online and World of Warcraft";
desktopName = "Minion";
categories = [ "Game" ];
})
];
meta = with lib; {
description = "MMO Addon manager";
homepage = "https://www.mmoui.com/";
platforms = platforms.linux ++ platforms.darwin;
};
}

View file

@ -62,6 +62,7 @@ lib.optionalAttrs (!minimal) {
./firefox.nix
./gpg
./impermanence.nix
./minion.nix
../common
../common/impermanence.nix

35
users/patrick/minion.nix Normal file
View file

@ -0,0 +1,35 @@
{ lib, pkgs, ... }:
let
# addon-path is base64 encode path
cfgFile = lib.writeText ''
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<minion>
<config-version>2</config-version>
<client>
<concurrent-updates>2</concurrent-updates>
<game-scan-depth>4</game-scan-depth>
<backup-dir>/home/patrick/.minion</backup-dir>
<dark-theme/>
</client>
<user>
<ga-user-id>d738b17b-2d14-4cb3-ab39-31ced61f7910</ga-user-id>
</user>
<game-configs never-ask-about-scanning="true">
<game-config game-id="WOW" scannable="false"/>
<game-config game-id="ESO" scannable="true"/>
</game-configs>
<drive-configs never-ask-about-scanning="true"/>
<games>
<game addon-path="L2hvbWUvcGF0cmljay8ubG9jYWwvc2hhcmUvU3RlYW1QYW56ZXIvc3RlYW1hcHBzL2NvbXBhdGRhdGEvMzA2MTMwL3BmeC9kcml2ZV9jL3VzZXJzL3N0ZWFtdXNlci9Eb2N1bWVudHMvRWxkZXIgU2Nyb2xscyBPbmxpbmUvbGl2ZS9BZGRPbnM=" auto-update="false" display-name="Elder Scrolls Online" game-id="ESO" unique-game-id="ESO-1"/>
</games>
</minion>
'';
in
{
home.packages = [ pkgs.minion ];
# yet another program that uses the config file as a live state file
# Why?
home.activation.installMinionConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run cp -f ${cfgFile} .minion/minion.xml
'';
}