From 7f972523f363485afc6154f7ec195bc532316ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 27 Jul 2024 18:19:10 +0200 Subject: [PATCH] steam: fix 32bit driver check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /host/etc/NIXOS only existed in the chroot - glxinfo does not write a proper error code on errors 🤦 --- pkgs/games/steam/fhsenv.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix index 8b504b6c55b6..b897582da7a4 100644 --- a/pkgs/games/steam/fhsenv.nix +++ b/pkgs/games/steam/fhsenv.nix @@ -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 < /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 [];