Autodetect NixOS and relaunch
Nix can start the Steam FHS environment with the additional required packages directly from nix-shell. Scripts can autodetect a NixOS environment and reexec, instead of requiring the user to manually specify packages.
The following was from lilijoyskyseeker on the FAF Discord.
SOLVED https://discord.com/channels/197033481883222026/1228471001633914950
Instead of running in the Ubuntu Distrobox, run it on NixOS with this:
- Make sure Steam is installed this way in your
configuration.nix
# steam
programs.steam = {
enable = true;
};
- add
# steam
programs.steam = {
enable = true;
# this here \/\/\/
package = with pkgs; steam.override { extraPkgs = pkgs: [
jq
cabextract
wget
]; };
# this here /\/\/\
};
- rebuild your system
- run the
setup.shwithsteam-run bash "<path-to-setup.sh>"(if you get spammed with a popup, just spam click OK) - follow the rest of the setup on the wiki substituting the command with being run with
steam-run bash "<other-commands>" - Profit!
- if you want you GUI to be able to launch the game after running
install-shortcut.sh, find the.desktopfile, mine was at~/.local/share/application/com.faforever.faf-linux.desktop, and edit theExecline to this:Exec=steam-run bash "<path-to-run>" - More profit!
many thanks again to <@261580158798921740>
maybe
nix-shell -p steam-run jq cabextract wget --run "steam-run bash '<command>'"
In extraPkgs it may be necessary to add pkgsi686Linux.libpulseaudio after the new steam package rework. Should be the same for nix-shell. Thanks to @yoty14 on DIscord for this information.
NIXPKGS_ALLOW_UNFREE=1 nix-shell -p steam-run jq cabextract wget pkgsi686Linux.libpulseaudio git --run "steam-run bash '/home/amourlive/code/game/faf-linux/setup.sh'"
looking for Steam...
found Steam: /home/amourlive/.local/share/Steam
found steam library folder: /home/amourlive/.local/share/Steam
found Proton - Experimental at /home/amourlive/.local/share/Steam/steamapps/common/Proton - Experimental
found Supreme Commander Forged Alliance at /home/amourlive/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance
============================================================
Checking required libraries...
============================================================
libvulkan.so.1 (libc6,x86-64) => /lib/libvulkan.so.1
libvulkan.so.1 (libc6) => /lib32/libvulkan.so.1
libpulse.so.0 (libc6,x86-64) => /lib/libpulse.so.0
could NOT find libpulse.so.0 (32-bit)
libfreetype.so.6 (libc6,x86-64) => /lib/libfreetype.so.6
libfreetype.so.6 (libc6) => /lib32/libfreetype.so.6
libXcomposite.so.1 (libc6,x86-64) => /lib/libXcomposite.so.1
libXcomposite.so.1 (libc6) => /lib32/libXcomposite.so.1
libXrandr.so.2 (libc6,x86-64) => /lib/libXrandr.so.2
libXrandr.so.2 (libc6) => /lib32/libXrandr.so.2
libXfixes.so.3 (libc6,x86-64) => /lib/libXfixes.so.3
libXfixes.so.3 (libc6) => /lib32/libXfixes.so.3
libXcursor.so.1 (libc6,x86-64) => /lib/libXcursor.so.1
libXcursor.so.1 (libc6) => /lib32/libXcursor.so.1
libXi.so.6 (libc6,x86-64) => /lib/libXi.so.6
libXi.so.6 (libc6) => /lib32/libXi.so.6
Could not find the following libraries:
- libpulse.so.0 (32-bit)
Please ensure you have installed the libraries mentioned in the readme.
In an hour and a half of trying to provide libpulse.so.0 (32-bit), I got nothing. The pkgsi686Linux.libpulseaudio is ignored, so I have no idea how to run faf-linux with pipewire.