Skip to content

Nix and NixOS: a flake that runs the launcher in Steam's runtime environment - #180

Merged
elripalda merged 5 commits into
elripalda:mainfrom
KevinBonnoron:nix-flake
Nov 17, 2026
Merged

elripalda merged 5 commits into
elripalda:mainfrom
KevinBonnoron:nix-flake

Conversation

@KevinBonnoron

@KevinBonnoron KevinBonnoron commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

This adds a Nix flake, so the launcher can be installed and run on NixOS (nix run github:elripalda/RecompLauncher). It also makes two small changes to the launcher that the package needs. Whether you want this here or in nixpkgs instead is open in #185.

Closes #185

Packaging (flake.nix, packaging/nix/)

  • recomplauncher-unwrapped (package.nix) is the launcher, built with cargo and tauri/custom-protocol the same way the Arch and Flatpak packages build it, without Node. The tray icon's library and libudev are loaded with dlopen, so they are added to the binary's RPATH.
  • recomplauncher (fhs.nix, the default package) runs the launcher inside Steam's runtime environment, through steam.buildRuntimeEnv, which nixpkgs' Steam and Heroic packages also use.
    • The recomps the launcher downloads are built for ordinary distributions (/lib64/ld-linux, /usr/lib), and they run there unchanged.
    • umu-run is included, so proton::runner() picks it for Windows recomps.
    • vkBasalt is included, so looks::vkbasalt_installed() finds it and Looks can use it. The layer only turns on for a game given a look (ENABLE_VKBASALT).
  • nix develop provides everything npm run dev and npm test need.
  • Docs: packaging/nix/README.md, linked from README.md and docs/BUILDING.md. /result is added to .gitignore.

Launcher

  • lib.rs: nix_managed() is true when the program runs from /nix/store. In that case, as for a Flatpak, no update is offered, and the Update button says to update through Nix. The store is read-only, and on Linux outside an AppImage the button would only have opened the .deb download page.
  • shortcuts.rs: start_path() reads RL_START_PATH when a package sets it. Without it, game shortcuts and Steam entries pointed at the binary inside the store. That binary runs outside the runtime environment, and its path disappears after the next update or garbage collection. The Nix wrapper sets RL_START_PATH to the path where the system finds the launcher, for example /run/current-system/sw/bin/recomplauncher.

How you tested it

On NixOS unstable (GNOME, Wayland), x86-64:

  • nix build, nix flake check and nixfmt --check pass.
  • The launcher starts, the first-run screens show, and the catalog and its images download.
  • Inside the environment: umu-run, /lib64/ld-linux-x86-64.so.2, SDL 2, SDL 3, Vulkan and vkBasalt's 64- and 32-bit layers are present, and libfuse.so.2 is not. The launcher's own vkBasalt check passes (it warned before vkBasalt was added). RL_START_PATH is an absolute path. The user's own GTK_IM_MODULE is kept, where Steam's profile would force xim.
  • Updates: I edited the cached version.json to announce a fake 0.90 Beta 99. The Nix build offers no update. The same binary copied out of the store offers Beta 99.
  • Games, played end to end through the Nix package:
    • Xenoblade Chronicles 2 (xc2-recomp): its setup AppImage built the game from my copy (with Setup AppImages unpack themselves on a PC without FUSE 2 #179, now merged), then Play started the native build.
    • Ocarina of Time (Ship of Harkinian, shipwright) and ComboShip: AppImages, which unpacked themselves at Play.
  • Not tested yet: a Windows recomp through umu-run and Proton.

Rebased on Beta 52 (0715c41): nix build passes again, and the tests give the same results as on main itself on NixOS:

  • npm test: 615 tests pass. The 4 that fail (a_game_that_hands_off_keeps_counting_while_its_folder_runs and three in update_rollback_tests) fail the same way on main on NixOS. They call /bin/sleep and /usr/bin/true, which NixOS doesn't have, and are unrelated to this change.
  • node --test tests/*.test.cjs: 256 tests pass. The 2 that fail, "AppImage helper waits for the old process…" and "AppImage helper cleans staging…" in appimage-update.test.cjs, fail on main too, for the same reason: they run /bin/sleep.
  • Tried it in the launcher (the Nix build)

Related: #179, merged, which lets setup AppImages start on NixOS, where there is no FUSE 2.

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • If it changes what developers can write in recomplauncher.json: the schema and docs are updated too (not applicable)

@KevinBonnoron KevinBonnoron changed the title Nix and NixOS: a flake, with the launcher in Steam's runtime environment Nix and NixOS: a flake that runs the launcher in Steam's runtime environment Nov 14, 2026
@KevinBonnoron
KevinBonnoron force-pushed the nix-flake branch 2 times, most recently from 25d7e9e to c3f0e66 Compare November 14, 2026 20:51
@KevinBonnoron
KevinBonnoron marked this pull request as ready for review November 15, 2026 12:22
…ronment

packaging/nix builds the launcher with cargo, the way the Arch and Flatpak packages do, and runs it inside the runtime environment that nixpkgs' Steam and Heroic use, with umu-run, so the recomps it downloads run unchanged on NixOS.

When it runs from the Nix store, the launcher neither offers nor installs its own updates: Nix updates it, as Flatpak does for the Flatpak build. Game shortcuts and Steam entries start it through RL_START_PATH when a package sets it, so they go through the wrapper and keep working after an update.
@Xarishark

Copy link
Copy Markdown
Collaborator

Thanks for this, it's carefully done. We pushed three small commits to your branch:

  • Adopt scan (4e825e0): the scan for games to adopt skipped Steam shortcuts that point at launcher_exe(). With RL_START_PATH, the launcher's own shortcuts point at the wrapper instead, so it would have offered them as games to adopt. It now also skips start_path(). Other builds don't change.
  • Steam icon on Nix (ee7283f): launcher_icon() gave Steam the binary's store path, which is gone after garbage collection. On Nix it now uses the profile's icon, next to RL_START_PATH (<profile>/share/icons/hicolor/512x512/apps/recomplauncher.png), and falls back to the old path.
  • README (981c8c0): a note that the Nix package is community-maintained and not officially supported. We're doing the same for Arch in Arch README: say the package is community-maintained #236.

On #185: we're happy to keep the flake here as a community package, with a CI job that isn't required to pass. If you can, please check the icon and the adopt list on NixOS. We only tested on Fedora (cargo test, 619 pass).

@KevinBonnoron

Copy link
Copy Markdown
Contributor Author

Tested on NixOS with the package installed in a profile. No Steam on this machine, so I used a throwaway Steam folder and checked what the launcher writes and reads in shortcuts.vdf, which is all these two changes touch.

• Icon: the Steam shortcut points at the profile (/share/icons/...), not /nix/store. I haven't seen it rendered in an actual Steam.
• Adopt list: with the launcher's shortcut and another "recomp" shortcut present, only the other one is offered.

Thanks for the fixes!

@Xarishark

Copy link
Copy Markdown
Collaborator

Happy to help! @elripalda ACK by me

@elripalda
elripalda merged commit d323520 into elripalda:main Nov 17, 2026
6 checks passed
@KevinBonnoron
KevinBonnoron deleted the nix-flake branch November 20, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nix and NixOS package

3 participants