From a5314b94ed4f6d864e478f264dce77632b55995a Mon Sep 17 00:00:00 2001 From: rafaelrc7 Date: Thu, 21 Mar 2024 22:17:55 -0300 Subject: [PATCH] starsector: passthrough cli args to jvm --- pkgs/games/starsector/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/games/starsector/default.nix b/pkgs/games/starsector/default.nix index 535039c79f2f..6a8831211627 100644 --- a/pkgs/games/starsector/default.nix +++ b/pkgs/games/starsector/default.nix @@ -62,15 +62,17 @@ stdenv.mkDerivation rec { # it tries to run everything with relative paths, which makes it CWD dependent # also point mod, screenshot, and save directory to $XDG_DATA_HOME - # additionally, add some GC options to improve performance of the game - # and remove flags "PermSize" and "MaxPermSize" that were removed with Java 8 + # additionally, add some GC options to improve performance of the game, + # remove flags "PermSize" and "MaxPermSize" that were removed with Java 8 and + # pass-through CLI args ($@) to the JVM. postPatch = '' substituteInPlace starsector.sh \ --replace-fail "./jre_linux/bin/java" "${openjdk}/bin/java" \ --replace-fail "./native/linux" "$out/share/starsector/native/linux" \ --replace-fail "=." "=\''${XDG_DATA_HOME:-\$HOME/.local/share}/starsector" \ --replace-warn "-XX:+CompilerThreadHintNoPreempt" "-XX:+UnlockDiagnosticVMOptions -XX:-BytecodeVerificationRemote -XX:+CMSConcurrentMTEnabled -XX:+DisableExplicitGC" \ - --replace-quiet " -XX:PermSize=192m -XX:MaxPermSize=192m" "" + --replace-quiet " -XX:PermSize=192m -XX:MaxPermSize=192m" "" \ + --replace-fail "com.fs.starfarer.StarfarerLauncher" "\"\$@\" com.fs.starfarer.StarfarerLauncher" ''; passthru.updateScript = writeScript "starsector-update-script" ''