steam: Check for NixOS, improve error message

This commit is contained in:
wchresta 2017-12-31 11:43:21 +01:00
parent 2fd1b95fad
commit f4c9cc6878

View File

@ -108,10 +108,21 @@ in buildFHSUserEnv rec {
runScript = writeScript "steam-wrapper.sh" '' runScript = writeScript "steam-wrapper.sh" ''
#!${stdenv.shell} #!${stdenv.shell}
glxinfo >/dev/null 2>&1 if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS
if [ ! "$?" = "0" ]; then glxinfo >/dev/null 2>&1
echo "*** WARNING: Test for 32-bit libGL unsuccessful." # If there was an error running glxinfo, we know something is wrong with the configuration
echo " This could mean you forgot to activate hardware.opengl.driSupport32Bit" 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 fi
steam steam
''; '';