steam: Check for NixOS, improve error message

wchresta f4c9cc68 2fd1b95f

+15 -4
+15 -4
pkgs/games/steam/chrootenv.nix
··· 108 108 109 109 runScript = writeScript "steam-wrapper.sh" '' 110 110 #!${stdenv.shell} 111 - glxinfo >/dev/null 2>&1 112 - if [ ! "$?" = "0" ]; then 113 - echo "*** WARNING: Test for 32-bit libGL unsuccessful." 114 - echo " This could mean you forgot to activate hardware.opengl.driSupport32Bit" 111 + if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS 112 + glxinfo >/dev/null 2>&1 113 + # If there was an error running glxinfo, we know something is wrong with the configuration 114 + if [ $? -ne 0 ]; then 115 + cat <<EOF > /dev/stderr 116 + ** 117 + WARNING: Steam is not set up. Add the following options to /etc/nixos/configuration.nix 118 + and then run \`sudo nixos-rebuild switch\`: 119 + { 120 + hardware.opengl.driSupport32Bit = true; 121 + hardware.pulseaudio.support32Bit = true; 122 + } 123 + ** 124 + EOF 125 + fi 115 126 fi 116 127 steam 117 128 '';