commit ecfc942d2e02c8d3a4e53bd021f335eade163b44
parent 01475561c3e862873f72b2e726bebd6a55a063ad
Author: breadcat <breadcat@users.noreply.github.com>
Date: Thu, 16 Oct 2025 19:26:24 +0100
Move JRE install to vidyascape script
I don't think this actually works mind
Diffstat:
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/machines/minerva.nix b/machines/minerva.nix
@@ -30,6 +30,7 @@ in
(import ../common/ydotool.nix {inherit pkgs username;})
../scripts/ctimerename.nix
../scripts/duupmove.nix
+ (import ../scripts/vidyascape.nix {inherit pkgs;})
(import ../scripts/restic.nix {inherit pkgs;})
];
home-manager = {
@@ -81,7 +82,6 @@ in
gallery-dl
glib
imagemagick
- jre8
lf
tofi
yt-dlp
diff --git a/scripts/vidyascape.nix b/scripts/vidyascape.nix
@@ -0,0 +1,53 @@
+{ pkgs, ... }:
+
+let
+ vidyascape = pkgs.writeShellScriptBin "vidyascape" ''
+
+# variables
+launcher_uri="https://vidyascape.org/files/vidyascape_launcher.jar"
+config_file="$HOME/.vscape2/settings.ini"
+declare -a configs=(
+ "dropPosition=2"
+ "enabled=true"
+ "hideAfter=3"
+ "legacyNpcs=false"
+ "legacyObjects=true"
+ "loginMusic=false"
+ "lowDetail=false"
+ "modernRendering=true"
+ "orbsOnRight=false"
+ "pixelScaling=1"
+ "preferredWorld=2"
+ "rememberCredentials=true"
+ "rememberWorld=true"
+ "sizeMode=RESIZABLE"
+ )
+
+# launcher binary
+if [ -f "/tmp/$(basename $launcher_uri)" ]; then
+ echo "Launcher exists, skipping"
+else
+ echo "Launcher doesn't exist, downloading."
+ curl -s -o "/tmp/$(basename $launcher_uri)" "$launcher_uri"
+fi
+
+# config file
+if [ -f "$config_file" ]; then
+ for kv in "''${configs[@]}"; do
+ key=''${kv%%=*}
+ value=''${kv#*=}
+ # Replace key value if exists
+ sed -i -E "s|^([[:space:]]*$key[[:space:]]*=[[:space:]]*).*|\1$value|" "$config_file"
+ done
+else
+ echo "Config doesn't exist so will not be patched until next run."
+fi
+
+# launch game
+echo "Launching game..."
+${pkgs.jre8}/bin/java -jar "/tmp/$(basename $launcher_uri)"
+ '';
+
+in {
+ environment.systemPackages = [ vidyascape ];
+}
+\ No newline at end of file