steam: use writeShellScript

This commit is contained in:
Atemu 2023-01-29 14:42:38 +01:00
parent 8f40f2f90b
commit 422b0ff93b

View file

@ -1,4 +1,4 @@
{ lib, stdenv, writeScript, buildFHSUserEnv, steam, glxinfo-i686, runtimeShell { lib, stdenv, writeShellScript, buildFHSUserEnv, steam, glxinfo-i686
, steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null , steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null
, extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs , extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs
, extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs , extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs
@ -228,8 +228,7 @@ in buildFHSUserEnv rec {
export SDL_JOYSTICK_DISABLE_UDEV=1 export SDL_JOYSTICK_DISABLE_UDEV=1
'' + extraProfile; '' + extraProfile;
runScript = writeScript "steam-wrapper.sh" '' runScript = writeShellScript "steam-wrapper.sh" ''
#!${runtimeShell}
if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS
${glxinfo-i686}/bin/glxinfo >/dev/null 2>&1 ${glxinfo-i686}/bin/glxinfo >/dev/null 2>&1
# If there was an error running glxinfo, we know something is wrong with the configuration # If there was an error running glxinfo, we know something is wrong with the configuration
@ -272,8 +271,7 @@ in buildFHSUserEnv rec {
inherit multiPkgs profile extraInstallCommands; inherit multiPkgs profile extraInstallCommands;
inherit unshareIpc unsharePid; inherit unshareIpc unsharePid;
runScript = writeScript "steam-run" '' runScript = writeShellScript "steam-run" ''
#!${runtimeShell}
run="$1" run="$1"
if [ "$run" = "" ]; then if [ "$run" = "" ]; then
echo "Usage: steam-run command-to-run args..." >&2 echo "Usage: steam-run command-to-run args..." >&2