Add a Nix flake for building and running #116

Open
github-bot wants to merge 13 commits from github-bot/gh-116 into main AGit
Owner

@⁠kekonn on GitHub · 2026-12-01 21:38 UTC · original
kekonn:feat/flake → main · +1109 −12 · 13 files · 13 commits · open

This keeps the user's environment clean and pins all dependencies.

Added SETUP.md explaining how it works.

Authored by Claude but tested by me on my machine (CachyOS, 5800X3D, RX 7900 XT).

**@⁠kekonn** on GitHub · 2026-12-01 21:38 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/116) `kekonn:feat/flake` → `main` · +1109 −12 · 13 files · 13 commits · open This keeps the user's environment clean and pins all dependencies. Added SETUP.md explaining how it works. Authored by Claude but tested by me on my machine (CachyOS, 5800X3D, RX 7900 XT).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
The SDK, the prebuilt DLLs, the patched RADV, vkd3d-proton and wineserver,
and the FSR4 DLLs are now flake packages (nix/*.nix), pinned and cached in
the store instead of fetched and built in deps/. The wrapper and dev shell
export their paths as VICTORY_* variables; the scripts use those and fall
back to deps/, so a plain ./setup.sh works as before.

`victory dev mesa|vkd3d|wine` builds one package from a patched checkout in
deps/ for incremental editing (save with `victory patch`), and
`victory dev off <name>` goes back to the store build. Dev builds now export
the Mesa library dirs as plain NIX_LDFLAGS too, so nixpkgs' meson keeps
their store RPATHs and the deps/ RADV actually loads.

The flake accepts the MSVC license (as XWIN_ACCEPT_LICENSE=1 does for
setup.sh) and pins its own hash for the SDK download.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
Conflicts in setup.sh: take main's step_tools (Mesa pkg-config check, meson
venv check), skipping the pkg-config check when the flake provides Mesa and
keeping the flake's early return before the venv; take main's unconditional
xwin --accept-license (drops XWIN_ACCEPT_LICENSE); keep the flake's FSR4
store branch and add main's frame-generation DLL to it and to nix/fsr4.nix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 21:42:26 +00:00
Conflict in setup.sh step_prefix: main moved the vkd3d DLL install into
install_vkd3d() (also called when a rebuilt vkd3d meets an existing
prefix); the flake's VICTORY_VKD3D store copy now lives inside that helper,
and step_prefix keeps taking dxgi/d3dcompiler from VICTORY_WIN_DLLS.

flake.nix: `dev off` treats a checkout as saved when its diff matches
.git/um-patch in either index form, as main's source_of now does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015e3AVzmnUWSQy9ju5Vwu5a
Author
Owner

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

This is the healthiest PR I read in the older half of the backlog: it tracks main (0 commits behind), it hooks setup.sh (the four VICTORY_MSVC/WIN_DLLS/RADV_ICD/VKD3D points) instead of rewriting it, and it is the right shape for a one-stack project. Worth splitting rather than closing.

Before it lands:

  • nix/radv.nix:17-19 does inherit (mesa) version src;, so Mesa comes from whatever nixos-unstable carries rather than from setup.sh's pinned mesa-26.3.1. patches/mesa.patch is written against a specific Mesa; pin the rev like nix/vkd3d-proton.nix:18 already does (71cae091…) — the competing Nix PR gets this right and is worth copying.
  • The new 330-line top-level SETUP.md duplicates docs/BUILD.md, which is the canonical build doc (split out of the README deliberately). Two build docs disagree within a month; fold the Nix section into docs/BUILD.md and delete the file.
  • Accepting Microsoft's licence at evaluation time (microsoftVisualStudioLicenseAccepted = true plus allowUnfreePredicate) is defensible — it mirrors setup.sh's xwin --accept-license — but it is a policy decision the maintainer should make knowingly, so say it in the description.
  • The four hooks are undocumented in docs/BUILD.md/docs/SETTINGS.md; from_flake printing which step was skipped is what keeps failures debuggable, so document that too.

Split: flake + derivations + hooks (with Mesa pinned) in one PR, docs folding in the same one. Then it is a normal review.

**@⁠Luxuride** on GitHub · 2026-12-04 12:03 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/116#issuecomment-7410915048) This is the healthiest PR I read in the older half of the backlog: it tracks main (0 commits behind), it hooks `setup.sh` (the four `VICTORY_MSVC`/`WIN_DLLS`/`RADV_ICD`/`VKD3D` points) instead of rewriting it, and it is the right shape for a one-stack project. Worth splitting rather than closing. Before it lands: - `nix/radv.nix:17-19` does `inherit (mesa) version src;`, so Mesa comes from whatever `nixos-unstable` carries rather than from `setup.sh`'s pinned `mesa-26.3.1`. `patches/mesa.patch` is written against a specific Mesa; pin the rev like `nix/vkd3d-proton.nix:18` already does (`71cae091…`) — the competing Nix PR gets this right and is worth copying. - The new 330-line top-level `SETUP.md` duplicates `docs/BUILD.md`, which is the canonical build doc (split out of the README deliberately). Two build docs disagree within a month; fold the Nix section into `docs/BUILD.md` and delete the file. - Accepting Microsoft's licence at evaluation time (`microsoftVisualStudioLicenseAccepted = true` plus `allowUnfreePredicate`) is defensible — it mirrors `setup.sh`'s `xwin --accept-license` — but it is a policy decision the maintainer should make knowingly, so say it in the description. - The four hooks are undocumented in `docs/BUILD.md`/`docs/SETTINGS.md`; `from_flake` printing which step was skipped is what keeps failures debuggable, so document that too. Split: flake + derivations + hooks (with Mesa pinned) in one PR, docs folding in the same one. Then it is a normal review.
This pull request has changes conflicting with the target branch.
  • build.sh
  • setup.sh
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/116/head:github-bot/gh-116'
git switch 'github-bot/gh-116'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-116'
git switch 'github-bot/gh-116'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-116'
git switch 'github-bot/gh-116'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-116'
git switch 'main'
git merge --squash 'github-bot/gh-116'
git switch 'main'
git merge --ff-only 'github-bot/gh-116'
git switch 'main'
git merge 'github-bot/gh-116'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.