# 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. Patch the downloaded files for NixOS ⚠️ This is the one NixOS-specific step. The game engine files the launcher just downloaded won't run on NixOS out of the box, so we need to patch them. The `opengoal-patch-bins` script is included with this package — the same install that gave you `opengoal-launcher` also gives you this script. Open a terminal and run: ```bash opengoal-patch-bins /path/to/your/install/folder/versions/official/v0.3.1 ``` Replace the path with wherever you told the launcher to install in Step 1, and replace `v0.3.1` with whatever version the launcher downloaded. You can find the correct version number by looking inside the `versions/official/` folder in your install directory. For example, if you installed to `/home/user/Games/opengoal` it would be: ```bash opengoal-patch-bins /home/user/Games/opengoal/versions/official/v0.3.1 ``` You should see `Done: gk`, `Done: extractor`, and `Done: goalc` printed out. If you see "already patched" for all three, see the Troubleshooting section. 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.