build: add nix flake packaging #157

Closed
github-bot wants to merge 5 commits from github-bot/gh-157 into main AGit
Owner

@⁠hazre on GitHub · 2026-12-02 03:51 UTC · original
hazre:nix-flake → main · +702 −42 · 9 files · 5 commits · closed without merging

Adds nix packaging for easy to use and reproducible builds, that works on any distro (just requires Nix to be installed)

Makes it so you can try xmem with a single command

nix run . -- play /path/to/your/dump
nix run . -- shaders /path/to/your/dump
nix run . -- warm /path/to/your/dump

run.conf beside the checkout can set GAME, WINEPREFIX, VICTORY_STATE,
MESA_SHADER_CACHE_DIR and VKD3D_SHADER_CACHE_PATH, so the game path is
optional:

nix run . -- play

Also disables wineopenxr in run.sh: vkd3d-proton loads it for VR device
extensions, and a running OpenXR runtime adds Linux-only
VK_KHR_external_{semaphore,fence}_fd extensions that winevulkan cannot
expose, so D3D12 device creation fails (0x80004005, "no host GPU").

**@⁠hazre** on GitHub · 2026-12-02 03:51 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/157) `hazre:nix-flake` → `main` · +702 −42 · 9 files · 5 commits · closed without merging Adds nix packaging for easy to use and reproducible builds, that works on any distro (just requires Nix to be installed) Makes it so you can try xmem with a single command ```sh nix run . -- play /path/to/your/dump nix run . -- shaders /path/to/your/dump nix run . -- warm /path/to/your/dump ``` `run.conf` beside the checkout can set `GAME`, `WINEPREFIX`, `VICTORY_STATE`, `MESA_SHADER_CACHE_DIR` and `VKD3D_SHADER_CACHE_PATH`, so the game path is optional: ```sh nix run . -- play ``` Also disables `wineopenxr` in `run.sh`: vkd3d-proton loads it for VR device extensions, and a running OpenXR runtime adds Linux-only `VK_KHR_external_{semaphore,fence}_fd` extensions that winevulkan cannot expose, so D3D12 device creation fails (`0x80004005`, "no host GPU").
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 03:52:58 +00:00
github-bot changed title from Add Nix Packaging to build: add nix packaging 2026-12-02 05:12:54 +00:00
github-bot force-pushed github-bot/gh-157 from 33b1c1cc28 to 0e4352d559 2026-12-02 05:19:10 +00:00 Compare
github-bot force-pushed github-bot/gh-157 from 0e4352d559 to 740ca81f05 2026-12-02 05:35:04 +00:00 Compare
github-bot force-pushed github-bot/gh-157 from 740ca81f05 to f240877eb6 2026-12-03 03:46:34 +00:00 Compare
github-bot force-pushed github-bot/gh-157 from f240877eb6 to c6e2e1f373 2026-12-03 04:05:11 +00:00 Compare
github-bot force-pushed github-bot/gh-157 from c6e2e1f373 to 91bb0108cc 2026-12-03 04:11:47 +00:00 Compare
github-bot changed title from build: add nix packaging to build: add nix flake packaging 2026-12-03 04:20:01 +00:00
The 11-16 tarball still carries 0078 (the wineserver keeps process views in a red-black tree), and it is the stack the Linux runs are tested on.

Signed-off-by: hazre <[email protected]>
The flake's tree is a read-only store path and ships no run.conf, so the wrapper ignored the user's settings. Look for run.conf beside the caller (VICTORY_CONF names one), ship run.conf.default and presets in the tree, and keep the menu's state, restart flag and benchmark output under VICTORY_STATE. GAME and the state, prefix and driver-cache paths can now live in run.conf.

Signed-off-by: hazre <[email protected]>
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:01 UTC · original

This loses to #116 on the thing that matters: #116 reuses setup.sh/build.sh and keeps the MSVC build, while this one builds the DLLs with MinGW — nix/package.nix:27 rustPlatform.buildRustPackage under pkgsCross.mingw-msvcrt-x86_64, :59 adds -lmcfgthread, :62 links windows.mcfgthreads. nix/package.nix:1 asserts "only the C runtime differs", which is exactly where mingw's emulated TLS stops being true, and every tested run of this project uses the MSVC binary. A Nix package shipping a GNU-ABI binary is a second, untested platform, not a packaging change.

Also unrelated behaviour bundled in: env.sh:58 rewrites prefix selection so existing Proton users get a fresh prefix at the next launch (no DXVK state, no shader cache, a "why is my prefix gone" report), and the tip commit disables wineopenxr, which main does not reference at all.

Two parts are useful on their own and deserve their own PRs: the run.sh mode handling and reading run.conf from the invocation directory.

**@⁠Luxuride** on GitHub · 2026-12-04 12:01 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/157#issuecomment-7410868758) This loses to #116 on the thing that matters: #116 reuses `setup.sh`/`build.sh` and keeps the MSVC build, while this one builds the DLLs with MinGW — `nix/package.nix:27` `rustPlatform.buildRustPackage` under `pkgsCross.mingw-msvcrt-x86_64`, `:59` adds `-lmcfgthread`, `:62` links `windows.mcfgthreads`. `nix/package.nix:1` asserts "only the C runtime differs", which is exactly where mingw's emulated TLS stops being true, and every tested run of this project uses the MSVC binary. A Nix package shipping a GNU-ABI binary is a second, untested platform, not a packaging change. Also unrelated behaviour bundled in: `env.sh:58` rewrites prefix selection so existing Proton users get a fresh prefix at the next launch (no DXVK state, no shader cache, a "why is my prefix gone" report), and the tip commit disables wineopenxr, which `main` does not reference at all. Two parts are useful on their own and deserve their own PRs: the `run.sh` mode handling and reading `run.conf` from the invocation directory.
Author
Owner

@⁠hazre on GitHub · 2026-12-04 14:20 UTC · original

I intentionally went with a nix first approach, not trying to reuse build.sh, because it wouldn't be nix native (using nix packaged packages). Regarding MSVC, it would make the setup unfree and it would depend on proprietary binaries. That's why I went with MinGW which ships as part of the main way to cross compile for windows in nixpkgs. I don't mind swapping that for MSVC so it stays closer to setup.sh if that's what the maintainers want.

How paths are derived in env.sh got changed, so it's easier to customize but it doesn't change the expected defaults.

wineopenxr thing is something I noticed I use VR and it's just a harmless flag for people that don't use any headsets, it's mostly to avoid the logs being spammed about it and false positive errors like sdl3 not being found (because its required by the openxr loader)

I can split up into multiple PRs but this was just more convenient.

**@⁠hazre** on GitHub · 2026-12-04 14:20 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/157#issuecomment-7414192303) I intentionally went with a nix first approach, not trying to reuse build.sh, because it wouldn't be nix native (using nix packaged packages). Regarding MSVC, it would make the setup `unfree` and it would depend on proprietary binaries. That's why I went with MinGW which ships as part of the main way to cross compile for windows in nixpkgs. I don't mind swapping that for MSVC so it stays closer to setup.sh if that's what the maintainers want. How paths are derived in `env.sh` got changed, so it's easier to customize but it doesn't change the expected defaults. wineopenxr thing is something I noticed I use VR and it's just a harmless flag for people that don't use any headsets, it's mostly to avoid the logs being spammed about it and false positive errors like sdl3 not being found (because its required by the openxr loader) I can split up into multiple PRs but this was just more convenient.
github-bot closed this pull request 2026-12-05 17:38:51 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.