Repository navigation
Nix and NixOS: a flake that runs the launcher in Steam's runtime environment - #180
Conversation
6c81807 to
0d46b2e
Compare
25d7e9e to
c3f0e66
Compare
…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.
c3f0e66 to
1ee9b77
Compare
|
Thanks for this, it's carefully done. We pushed three small commits to your branch:
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 ( |
|
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. Thanks for the fixes! |
|
Happy to help! @elripalda ACK by me |
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 andtauri/custom-protocolthe same way the Arch and Flatpak packages build it, without Node. The tray icon's library and libudev are loaded withdlopen, so they are added to the binary's RPATH.recomplauncher(fhs.nix, the default package) runs the launcher inside Steam's runtime environment, throughsteam.buildRuntimeEnv, which nixpkgs' Steam and Heroic packages also use./lib64/ld-linux,/usr/lib), and they run there unchanged.umu-runis included, soproton::runner()picks it for Windows recomps.looks::vkbasalt_installed()finds it and Looks can use it. The layer only turns on for a game given a look (ENABLE_VKBASALT).nix developprovides everythingnpm run devandnpm testneed.packaging/nix/README.md, linked fromREADME.mdanddocs/BUILDING.md./resultis 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.debdownload page.shortcuts.rs:start_path()readsRL_START_PATHwhen 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 setsRL_START_PATHto 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 checkandnixfmt --checkpass.umu-run,/lib64/ld-linux-x86-64.so.2, SDL 2, SDL 3, Vulkan and vkBasalt's 64- and 32-bit layers are present, andlibfuse.so.2is not. The launcher's own vkBasalt check passes (it warned before vkBasalt was added).RL_START_PATHis an absolute path. The user's ownGTK_IM_MODULEis kept, where Steam's profile would forcexim.version.jsonto announce a fake 0.90 Beta 99. The Nix build offers no update. The same binary copied out of the store offers Beta 99.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.shipwright) and ComboShip: AppImages, which unpacked themselves at Play.Rebased on Beta 52 (0715c41):
nix buildpasses again, and the tests give the same results as onmainitself on NixOS:npm test: 615 tests pass. The 4 that fail (a_game_that_hands_off_keeps_counting_while_its_folder_runsand three inupdate_rollback_tests) fail the same way onmainon NixOS. They call/bin/sleepand/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…" inappimage-update.test.cjs, fail onmaintoo, for the same reason: they run/bin/sleep.Related: #179, merged, which lets setup AppImages start on NixOS, where there is no FUSE 2.
Checklist
recomplauncher.json: the schema and docs are updated too (not applicable)