summary refs log tree commit diff
path: root/pkgs/games/steam/chrootenv.nix
diff options
context:
space:
mode:
authorwchresta <34962284+wchresta@users.noreply.github.com>2017-12-31 11:43:21 +0100
committerwchresta <34962284+wchresta@users.noreply.github.com>2017-12-31 13:24:45 +0100
commitf4c9cc6878ee262730833a98d7fa55cbb29601ac (patch)
tree181a1f87df9b420687a54db48542897a0a60a26a /pkgs/games/steam/chrootenv.nix
parent2fd1b95fad27331307bfd14bda731e5997d60908 (diff)
downloadnixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar.gz
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar.bz2
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar.lz
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar.xz
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.tar.zst
nixpkgs-f4c9cc6878ee262730833a98d7fa55cbb29601ac.zip
steam: Check for NixOS, improve error message
Diffstat (limited to 'pkgs/games/steam/chrootenv.nix')
-rw-r--r--pkgs/games/steam/chrootenv.nix19
1 files changed, 15 insertions, 4 deletions
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index 019b1577e15..49d786284da 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -108,10 +108,21 @@ in buildFHSUserEnv rec {
 
   runScript = writeScript "steam-wrapper.sh" ''
     #!${stdenv.shell}
-    glxinfo >/dev/null 2>&1
-    if [ ! "$?" = "0" ]; then
-      echo "*** WARNING: Test for 32-bit libGL unsuccessful."
-      echo "             This could mean you forgot to activate hardware.opengl.driSupport32Bit"
+    if [ -f /host/etc/NIXOS ]; then   # Check only useful on NixOS
+      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
     steam
   '';