Skip to content

Commit

Permalink
steam: un-decimate
Browse files Browse the repository at this point in the history
A bunch of issues were found with the decimated steam, particularly around the
use of the new `inlcudeClosures`. Adding gamemode or gamescope to steam's
`extraPackages` would break in odd ways for instance and those appear to be
common patterns.

NixOS#350598
NixOS#308097

We definitely want to use something like `includeClosures` in the future but
let's revert back to just listing all deps in order to not have a broken steam
for 24.11.

NixOS#351928 aims to fix the issues experienced
here but is a breaking change and a bit too close for comfort w.r.t. staging
cycles.

Game specific libraries are disabled by default now though because
pressure-vessel should be able to take care of those before 24.11
releases. (Though you never know with Valve-time...) The flag to restore the
game specific libraries is retained just in case.

This partially reverts a3ccb7f
  • Loading branch information
Atemu committed Oct 29, 2024
1 parent bb50fc7 commit 5fe6178
Showing 1 changed file with 146 additions and 12 deletions.
158 changes: 146 additions & 12 deletions pkgs/by-name/st/steam/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
extraBwrapArgs ? [ ], # extra arguments to pass to bubblewrap (real default is at usage site)
extraArgs ? "", # arguments to always pass to steam
extraEnv ? { }, # Environment variables to pass to Steam
withGameSpecificLibraries ? false, # include game specific libraries
}:
let
steamEnv = { name, runScript, passthru ? {}, meta ? {} }:
buildFHSEnv {
inherit name runScript passthru meta;

multiArch = true;
includeClosures = true;

# https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md#command-line-tools
targetPkgs = pkgs: with pkgs; [
Expand Down Expand Up @@ -45,23 +45,157 @@ let
'')
] ++ extraPkgs pkgs;

# https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md#shared-libraries
multiPkgs = pkgs: with pkgs; [
glibc
libxcrypt
# These are required by steam with proper errors
xorg.libXcomposite
xorg.libXtst
xorg.libXrandr
xorg.libXext
xorg.libX11
xorg.libXfixes
libGL
libva
pipewire

# steamwebhelper
harfbuzz
libthai
pango

lsof # friends options won't display "Launch Game" without it
file # called by steam's setup.sh

# dependencies for mesa drivers, needed inside pressure-vessel
mesa.llvmPackages.llvm.lib
vulkan-loader
expat
wayland
xorg.libxcb
xorg.libXdamage
xorg.libxshmfence
xorg.libXxf86vm
elfutils

# Without these it silently fails
xorg.libXinerama
xorg.libXcursor
xorg.libXrender
xorg.libXScrnSaver
xorg.libXi
xorg.libSM
xorg.libICE
curl
nspr
nss
cups
libcap
SDL2
libusb1
dbus-glib
gsettings-desktop-schemas
ffmpeg
libudev0-shim

# Verified games requirements
fontconfig
freetype
xorg.libXt
xorg.libXmu
libogg
libvorbis
SDL
SDL2_image
glew110
libdrm
mesa # for libgbm
libidn
tbb
zlib

# SteamVR
udev
libudev0-shim
libva
vulkan-loader
dbus

# Other things from runtime
glib
gtk2
bzip2
flac
libglut
libjpeg
libpng
libpng12
libsamplerate
libmikmod
libtheora
libtiff
pixman
speex
SDL_image
SDL_ttf
SDL_mixer
SDL2_ttf
SDL2_mixer
libappindicator-gtk2
libdbusmenu-gtk2
libindicator-gtk2
libcaca
libcanberra
libgcrypt
libunwind
libvpx
librsvg
xorg.libXft
libvdpau

# required by coreutils stuff to run correctly
# Steam ends up with LD_LIBRARY_PATH=/usr/lib:<bunch of runtime stuff>:<etc>
# which overrides DT_RUNPATH in our binaries, so it tries to dynload the
# very old versions of stuff from the runtime.
# FIXME: how do we even fix this correctly
attr
# same thing, but for Xwayland (usually via gamescope), already in the closure
libkrb5
keyutils
] ++ lib.optionals withGameSpecificLibraries [
# Not formally in runtime but needed by some games
at-spi2-atk
at-spi2-core # CrossCode
gst_all_1.gstreamer
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-base
json-glib # paradox launcher (Stellaris)
libxkbcommon # paradox launcher
libvorbis # Dead Cells
libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2
mono
ncurses # Crusader Kings III
openssl
xorg.xkeyboardconfig
xorg.libpciaccess
xorg.libXScrnSaver # Dead Cells
icu # dotnet runtime, e.g. Stardew Valley

# screeps dependencies
gtk3
zlib
atk
cairo
gdk-pixbuf

# Prison Architect
libGLU
libuuid
libbsd
alsa-lib

networkmanager # not documented, used for network status things in Big Picture
# FIXME: figure out how to only build libnm?
libcap # not documented, required by srt-bwrap
] ++ extraLibraries pkgs;
# Loop Hero
# FIXME: Also requires openssl_1_1, which is EOL. Either find an alternative solution, or remove these dependencies (if not needed by other games)
libidn2
libpsl
nghttp2.lib
rtmpdump
]
++ extraLibraries pkgs;

extraInstallCommands = lib.optionalString (steam-unwrapped != null) ''
ln -s ${steam-unwrapped}/share $out/share
Expand Down

0 comments on commit 5fe6178

Please sign in to comment.