Skip to content

Instantly share code, notes, and snippets.

@jonringer
Last active February 2, 2022 19:37
Show Gist options
  • Save jonringer/6265d81455e1096dca9fe9c25cc21100 to your computer and use it in GitHub Desktop.
Save jonringer/6265d81455e1096dca9fe9c25cc21100 to your computer and use it in GitHub Desktop.
#!/nix/store/2kh3c4v2vf6d6xg6c9n8zvfpwf3zzwca-bash-5.1-p12/bin/bash
if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS
/nix/store/z3qg0z1699cqqv1f1j3z8rz8spa7whqq-glxinfo-8.4.0/bin/glxinfo >/dev/null 2>&1
# If there was an error running glxinfo, we know something is wrong with the configuration
if [ $? -ne 0 ]; then
cat <<EOF > /dev/stderr
**
WARNING: Steam is not set up. Add the following options to /etc/nixos/configuration.nix
and then run \`sudo nixos-rebuild switch\`:
{
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
}
**
EOF
fi
fi
export LD_LIBRARY_PATH=/lib64:/lib32:/steamrt/amd64/lib/x86_64-linux-gnu:/steamrt/amd64/lib:/steamrt/amd64/usr/lib/x86_64-linux-gnu:/steamrt/amd64/usr/lib:/steamrt/i386/lib/i386-linux-gnu:/steamrt/i386/lib:/steamrt/i386/usr/lib/i386-linux-gnu:/steamrt/i386/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
export STEAM_LD_LIBRARY_PATH="$STEAM_LD_LIBRARY_PATH${STEAM_LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
if [ -r $HOME/.local/share/Steam/bootstrap.tar.xz ]; then
chmod +w $HOME/.local/share/Steam/bootstrap.tar.xz
fi
exec steam "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment