steam: fix 32bit driver check

- /host/etc/NIXOS only existed in the chroot
- glxinfo does not write a proper error code on errors 🤦
This commit is contained in:
Sandro Jäckel 2024-07-27 18:19:10 +02:00
parent cb36a91818
commit 7f972523f3
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -271,10 +271,10 @@ in buildFHSEnv rec {
'' + extraProfile;
runScript = writeShellScript "steam-wrapper.sh" ''
if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS
${glxinfo-i686}/bin/glxinfo >/dev/null 2>&1
if [ -f /etc/NIXOS ]; then # Check only useful on NixOS
${glxinfo-i686}/bin/glxinfo 2>&1 | grep -q Error
# If there was an error running glxinfo, we know something is wrong with the configuration
if [ $? -ne 0 ]; then
if [ $? -eq 0 ]; then
cat <<EOF > /dev/stderr
**
WARNING: Steam is not set up. Add the following options to /etc/nixos/configuration.nix
@ -303,6 +303,7 @@ in buildFHSEnv rec {
'' + args.extraPreBwrapCmds or "";
extraBwrapArgs = [
"--bind /etc/NIXOS /etc/NIXOS" # required 32bit driver check in runScript
"--bind-try /tmp/dumps /tmp/dumps"
] ++ args.extraBwrapArgs or [];