From 3422748fcc41f060df4c647e9ad0ae6c30546fd3 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 21 Apr 2026 11:50:15 -0400 Subject: [PATCH] removed result and added readme --- .gitignore | 2 + README.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++ result | 1 - 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 README.md delete mode 120000 result diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..750baeb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +result-* diff --git a/README.md b/README.md new file mode 100644 index 0000000..830aae6 --- /dev/null +++ b/README.md @@ -0,0 +1,141 @@ +# OpenGOAL Launcher for NixOS + +A Nix package for running [OpenGOAL](https://opengoal.dev) on NixOS — enabling native PC ports of the Jak and Daxter series through the official OpenGOAL Launcher. + +> **AI Disclosure:** This project was developed with heavy assistance from Claude (Anthropic). It works on my machine with all three games launching and playable, but your mileage may vary. Bug reports and PRs welcome. + +--- + +## Read More about OpenGOAL? +You can read more about OpenGOAL and the OpenGOAL launcher program with the resources below: +- [OpenGOAL](https://opengoal.dev) +- [OpenGOAL Launcher](https://github.com/open-goal/launcher) +- [OpenGOAL Github](https://github.com/open-goal) + +--- + +## Requirements + +- NixOS +- `nixpkgs.config.allowUnfree = true` (required for `steam-run`) +- A PS2 ISO of a supported game + +--- + +## Installation + +### Option A: Ad-hoc (no system changes) + +```bash +git clone +cd opengoal-nix +nix-build +result/bin/opengoal-launcher +``` + +### Option B: System-wide via `configuration.nix` + +Add to `/etc/nixos/configuration.nix`: + +```nix +nixpkgs.config.allowUnfree = true; + +environment.systemPackages = [ + (pkgs.callPackage /path/to/opengoal-nix/package.nix {}) +]; +``` + +Then rebuild: + +```bash +sudo nixos-rebuild switch +opengoal-launcher +``` + +--- + +## First Time Setup + +1. Launch the launcher and set your install directory +2. Select a game and let the launcher download the game version binaries +3. **Run the patch script** to make the downloaded binaries NixOS-compatible: + +```bash +opengoal-patch-bins /path/to/opengoal/versions/official/vX.Y.Z +``` + +For example: +```bash +opengoal-patch-bins ~/.local/share/opengoal/versions/official/v0.3.1 +``` + +4. Point the launcher at your PS2 ISO and let it extract, decompile, and compile the game +5. Click Play + +> **Note:** You must re-run `opengoal-patch-bins` each time the launcher downloads a new game version. + +--- + +## Updating the Launcher + +When a new launcher version is released on [GitHub](https://github.com/open-goal/launcher/releases): + +1. Get the new hash: +```bash +nix-shell -p nix --run ' + nix-prefetch-url \ + https://github.com/open-goal/launcher/releases/download/vX.Y.Z/OpenGOAL-Launcher_X.Y.Z_amd64.AppImage \ + --type sha256 +' +``` + +2. Convert to SRI format: +```bash +nix-shell -p nix --run ' + nix hash convert --hash-algo sha256 --to sri +' +``` + +3. Update `version` and `hash` in `package.nix` and rebuild: +```bash +nix-build +``` + +--- + +## Troubleshooting + +**Game crashes with code 134 after clicking Play** +Run `opengoal-patch-bins` on the version directory — the game binaries need to be patched for NixOS after each download. + +**`opengoal-patch-bins` says "already patched" but game still crashes** +Restore the originals and repatch: +```bash +cd /path/to/opengoal/versions/official/vX.Y.Z +for bin in gk extractor goalc; do + [ -f "$bin.real" ] && mv "$bin.real" "$bin" +done +opengoal-patch-bins /path/to/opengoal/versions/official/vX.Y.Z +``` + +**GPU test failed / OpenGL error** +Your GPU and drivers support OpenGL — this is a false positive on NixOS. Use the "Bypass error" option in the launcher. + +**Wrong ISO error during extraction** +Make sure you are using a PS2 ISO of the original game, not a PSP version. Supported game IDs are SCUS-97124 (Jak 1 NTSC-U), SCES-50456 (PAL), and SCPS-15021 (NTSC-J). + +--- + +## How It Works + +The OpenGOAL Launcher is distributed as a DwarFS AppImage (not the more common SquashFS). This package: + +1. Fetches the AppImage and extracts it using `dwarfsextract` +2. Installs the self-contained [sharun](https://github.com/VHSgunzo/sharun) launcher bundle +3. Provides `opengoal-patch-bins` — a helper that patches downloaded game binaries (`gk`, `extractor`, `goalc`) with the correct NixOS dynamic linker and wraps them in `steam-run` for a full FHS environment + +--- + +## Contributing + +PRs and issues welcome. The eventual goal is to upstream this to nixpkgs. \ No newline at end of file diff --git a/result b/result deleted file mode 120000 index 6f50428..0000000 --- a/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/rcywa2yb7h57rbn3mcyw6yxxh42bjqpn-opengoal-launcher-2.9.1 \ No newline at end of file