From 813740a1e93cb5d9d6620faad43ea52c06782e15 Mon Sep 17 00:00:00 2001 From: gtb-sbe <361163825+gtb-sbe@users.noreply.github.com> Date: Thu, 26 Nov 2026 01:54:32 +0100 Subject: [PATCH] nix: pin GE-Proton11-14 in the development shell --- examples/lanes/README.md | 2 +- flake.nix | 13 +++++++++++++ tests/test_flake.py | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/test_flake.py diff --git a/examples/lanes/README.md b/examples/lanes/README.md index 81598de..fcdc649 100644 --- a/examples/lanes/README.md +++ b/examples/lanes/README.md @@ -7,7 +7,7 @@ Lanes is an original, turn-based homebrew game for Project TuxBox. Collect as ma Use an x86-64 PC with Python 3.10 or newer, Rust 1.95 or newer with Cargo, and the DirectX Shader Compiler (`dxc`) on your PATH. Add the Windows build target once with `rustup target add x86_64-pc-windows-msvc`. [DirectX Shader Compiler releases](https://github.com/microsoft/DirectXShaderCompiler/releases) - **Linux** needs `clang-cl`, `lld-link` and the Windows SDK and C runtime staged with xwin. To stage them in the cargo-xwin cache that `build.py` reads, run `cargo install cargo-xwin` and then `cargo xwin cache xwin --xwin-arch x86_64` once. If the SDK is outside the cargo-xwin cache, set `XWIN_SDK_ROOT` to the directory containing `sdk/` and `crt/`. The launcher builds a small Vulkan layer on first run, so also install the Vulkan headers (`vulkan-headers` on Arch). Use Microsoft's Linux DXC release: Arch's `directx-shader-compiler` 1.10.2605.37 aborts on every shader, and `build.py` reports this before building. Install UMU (`umu-run`, the `umu-launcher` package in the AUR on Arch) and [GE-Proton11-14](https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/GE-Proton11-14), extracted into Steam's `compatibilitytools.d`, to play. From the project folder, run `python3 -m venv .venv` and `source .venv/bin/activate` before installing the Python dependencies. -- **Nix** users can run `nix develop` (or `direnv allow`) for a shell with these Linux tools. The Windows SDK still needs `cargo xwin cache xwin --xwin-arch x86_64` once, and Proton Experimental comes from Steam. On NixOS, prefix the GPU checks with `tuxbox-fhs` (`tuxbox-fhs python tuxbox.py check ...`), which supplies the system libraries that Proton's Wine expects. +- **Nix** users can run `nix develop` (or `direnv allow`) for a shell with these Linux tools. The Windows SDK still needs `cargo xwin cache xwin --xwin-arch x86_64` once. The shell also provides GE-Proton11-14 and sets `PROTONPATH` to it, so the launcher uses it without a Steam install; pass `--proton "$PROTONPATH"` to `tuxbox.py check` for the GPU checks. On NixOS, prefix the GPU checks with `tuxbox-fhs` (`tuxbox-fhs python tuxbox.py check ...`), which supplies the system libraries that Proton's Wine expects. - **Windows** needs Visual Studio Build Tools with the C++ tools and Windows SDK. Run the commands in an **x64 Native Tools Command Prompt**. ## Build and play diff --git a/flake.nix b/flake.nix index 3d0b19d..9f90911 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,15 @@ targets = ["x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc"]; }; + # The launcher's default Proton (PINNED_PROTON in project_tuxbox/host.py). + # nixpkgs' proton-ge-bin follows its own release schedule, so pin the + # upstream release archive here and keep both versions in sync. + proton-ge = pkgs.fetchzip { + name = "GE-Proton11-14"; + url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton11-14/GE-Proton11-14-x86_64.tar.gz"; + hash = "sha256-Bru3l0AqrvDl+XYC1dYhmy5XqKP49yFjWVJwZzel60Q="; + }; + tools = with pkgs; [ # Languages rust @@ -88,6 +97,8 @@ runScript = "env"; }; in { + packages.proton-ge = proton-ge; + devShells.default = pkgs.mkShell { packages = tools ++ [fhs]; buildInputs = [pkgs.lz4]; @@ -95,6 +106,8 @@ # Python loads these through ctypes LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.lz4 pkgs.libx11]; VULKAN_HEADERS_INCLUDE = "${pkgs.vulkan-headers}/include"; + + PROTONPATH = proton-ge; }; }); } diff --git a/tests/test_flake.py b/tests/test_flake.py new file mode 100644 index 0000000..0cec94a --- /dev/null +++ b/tests/test_flake.py @@ -0,0 +1,19 @@ +import re +import unittest +from pathlib import Path + +from project_tuxbox.host import PINNED_PROTON + +ROOT = Path(__file__).resolve().parents[1] + + +class FlakeTests(unittest.TestCase): + def test_dev_shell_pins_the_launcher_default_proton(self): + flake = (ROOT / "flake.nix").read_text(encoding="utf-8") + pinned = set(re.findall(r"GE-Proton\d+-\d+", flake)) + self.assertEqual(pinned, {PINNED_PROTON}) + self.assertIn("PROTONPATH", flake) + + +if __name__ == "__main__": + unittest.main()