Merge pull request #216972 from SuperSandro2000/steam-fhs-full

steam-small: init

authored by K900 and committed by GitHub 0870fc66 bc05763b

+83 -94
+2 -1
pkgs/games/steam/default.nix
··· 5 5 let 6 6 steamPackagesFun = self: let 7 7 inherit (self) callPackage; 8 - in { 8 + in rec { 9 9 steamArch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" 10 10 else if stdenv.hostPlatform.system == "i686-linux" then "i386" 11 11 else throw "Unsupported platform: ${stdenv.hostPlatform.system}"; ··· 21 21 else null; 22 22 inherit buildFHSUserEnv; 23 23 }; 24 + steam-fhsenv-small = steam-fhsenv.override { withGameSpecificLibraries = false; }; 24 25 steamcmd = callPackage ./steamcmd.nix { }; 25 26 }; 26 27 keep = self: { };
+80 -93
pkgs/games/steam/fhsenv.nix
··· 1 - { config, lib, writeScript, buildFHSUserEnv, steam, glxinfo-i686 1 + { lib, stdenv, writeScript, buildFHSUserEnv, steam, glxinfo-i686, runtimeShell 2 2 , steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null 3 3 , extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs 4 4 , extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs 5 5 , extraProfile ? "" # string to append to profile 6 6 , extraArgs ? "" # arguments to always pass to steam 7 - , runtimeOnly ? false 8 - , runtimeShell 9 - , stdenv 10 - 11 - # DEPRECATED 12 - , withJava ? config.steam.java or false 13 - , withPrimus ? config.steam.primus or false 7 + , withGameSpecificLibraries ? true # exclude game specific libraries 14 8 }: 15 9 16 10 let 17 - commonTargetPkgs = pkgs: with pkgs; 18 - [ 19 - # Needed for operating system detection until 20 - # https://github.com/ValveSoftware/steam-for-linux/issues/5909 is resolved 21 - lsb-release 22 - # Errors in output without those 23 - pciutils 24 - # Games' dependencies 25 - xorg.xrandr 26 - which 27 - # Needed by gdialog, including in the steam-runtime 28 - perl 29 - # Open URLs 30 - xdg-utils 31 - iana-etc 32 - # Steam Play / Proton 33 - python3 34 - # Steam VR 35 - procps 36 - usbutils 11 + commonTargetPkgs = pkgs: with pkgs; [ 12 + # Needed for operating system detection until 13 + # https://github.com/ValveSoftware/steam-for-linux/issues/5909 is resolved 14 + lsb-release 15 + # Errors in output without those 16 + pciutils 17 + # Games' dependencies 18 + xorg.xrandr 19 + which 20 + # Needed by gdialog, including in the steam-runtime 21 + perl 22 + # Open URLs 23 + xdg-utils 24 + iana-etc 25 + # Steam Play / Proton 26 + python3 27 + # Steam VR 28 + procps 29 + usbutils 37 30 38 - # electron based launchers need newer versions of these libraries than what runtime provides 39 - mesa 40 - sqlite 41 - ] ++ lib.optional withJava jdk8 # TODO: upgrade https://github.com/NixOS/nixpkgs/pull/89731 42 - ++ lib.optional withPrimus primus 43 - ++ extraPkgs pkgs; 31 + # electron based launchers need newer versions of these libraries than what runtime provides 32 + mesa 33 + sqlite 34 + ] ++ extraPkgs pkgs; 44 35 45 36 ldPath = lib.optionals stdenv.is64bit [ "/lib64" ] 46 37 ++ [ "/lib32" ] ··· 87 78 libthai 88 79 pango 89 80 90 - # Not formally in runtime but needed by some games 91 - at-spi2-atk 92 - at-spi2-core # CrossCode 93 - gst_all_1.gstreamer 94 - gst_all_1.gst-plugins-ugly 95 - gst_all_1.gst-plugins-base 96 - json-glib # paradox launcher (Stellaris) 97 - libdrm 98 - libxkbcommon # paradox launcher 99 - libvorbis # Dead Cells 100 - libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2 101 - mono 102 - xorg.xkeyboardconfig 103 - xorg.libpciaccess 104 - xorg.libXScrnSaver # Dead Cells 105 - udev # shadow of the tomb raider 106 - icu # dotnet runtime, e.g. stardew valley 107 - 108 - # screeps dependencies 109 - gtk3 110 - dbus 111 - zlib 112 - atk 113 - cairo 114 - freetype 115 - gdk-pixbuf 116 - fontconfig 117 - 118 - # friends options won't display "Launch Game" without it 119 - lsof 120 - 121 - # called by steam's setup.sh 122 - file 123 - 124 - # Prison Architect 125 - libGLU 126 - libuuid 127 - libbsd 128 - alsa-lib 129 - 130 - # Loop Hero 131 - libidn2 132 - libpsl 133 - nghttp2.lib 134 - openssl_1_1 135 - rtmpdump 81 + lsof # friends options won't display "Launch Game" without it 82 + file # called by steam's setup.sh 136 83 137 84 # dependencies for mesa drivers, needed inside pressure-vessel 138 85 mesa.llvmPackages.llvm.lib ··· 144 91 xorg.libxshmfence 145 92 xorg.libXxf86vm 146 93 libelf 147 - 148 - # pressure-vessel (required for mangohud and possibly more) 149 - elfutils.out 150 - 151 - # Required 152 - glib 153 - gtk2 154 - bzip2 94 + (lib.getLib elfutils) 155 95 156 96 # Without these it silently fails 157 97 xorg.libXinerama ··· 171 111 libusb1 172 112 dbus-glib 173 113 ffmpeg 174 - # Only libraries are needed from those two 175 114 libudev0-shim 176 115 177 116 # Verified games requirements 117 + fontconfig 118 + freetype 178 119 xorg.libXt 179 120 xorg.libXmu 180 121 libogg ··· 182 123 SDL 183 124 SDL2_image 184 125 glew110 126 + libdrm 185 127 libidn 186 128 tbb 129 + zlib 187 130 188 131 # Other things from runtime 132 + glib 133 + gtk2 134 + bzip2 189 135 flac 190 136 freeglut 191 137 libjpeg ··· 212 158 librsvg 213 159 xorg.libXft 214 160 libvdpau 215 - ] 216 - ++ steamPackages.steam-runtime-wrapped.overridePkgs 161 + ] ++ lib.optionals withGameSpecificLibraries [ 162 + # Not formally in runtime but needed by some games 163 + at-spi2-atk 164 + at-spi2-core # CrossCode 165 + gst_all_1.gstreamer 166 + gst_all_1.gst-plugins-ugly 167 + gst_all_1.gst-plugins-base 168 + json-glib # paradox launcher (Stellaris) 169 + libdrm 170 + libxkbcommon # paradox launcher 171 + libvorbis # Dead Cells 172 + libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2 173 + mono 174 + xorg.xkeyboardconfig 175 + xorg.libpciaccess 176 + xorg.libXScrnSaver # Dead Cells 177 + udev # Shadow of the Tomb Raider 178 + icu # dotnet runtime, e.g. Stardew Valley 179 + 180 + # screeps dependencies 181 + gtk3 182 + dbus 183 + zlib 184 + atk 185 + cairo 186 + freetype 187 + gdk-pixbuf 188 + fontconfig 189 + 190 + # Prison Architect 191 + libGLU 192 + libuuid 193 + libbsd 194 + alsa-lib 195 + 196 + # Loop Hero 197 + libidn2 198 + libpsl 199 + nghttp2.lib 200 + openssl_1_1 201 + rtmpdump 202 + ] ++ steamPackages.steam-runtime-wrapped.overridePkgs 217 203 ++ extraLibraries pkgs; 218 204 219 205 extraInstallCommands = '' ··· 266 252 exec steam ${extraArgs} "$@" 267 253 ''; 268 254 269 - inherit (steam) meta; 255 + meta = steam.meta // lib.optionalAttrs (!withGameSpecificLibraries) { 256 + description = steam.meta.description + " (without game specific libraries)"; 257 + }; 270 258 271 259 # allows for some gui applications to share IPC 272 260 # this fixes certain issues where they don't render correctly ··· 282 270 283 271 targetPkgs = commonTargetPkgs; 284 272 inherit multiPkgs profile extraInstallCommands; 285 - 286 273 inherit unshareIpc unsharePid; 287 274 288 275 runScript = writeScript "steam-run" ''
+1
pkgs/top-level/all-packages.nix
··· 35803 35803 }); 35804 35804 35805 35805 steam = steamPackages.steam-fhsenv; 35806 + steam-small = steamPackages.steam-fhsenv-small; 35806 35807 35807 35808 steam-run = steam.run; 35808 35809