diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index 31803f061dce..c93a34f61849 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -44,8 +44,8 @@ in { ''; apply = steam: steam.override (prev: { extraEnv = (lib.optionalAttrs (cfg.extraCompatPackages != [ ]) { - STEAM_EXTRA_COMPAT_TOOLS_PATHS = makeBinPath cfg.extraCompatPackages; - }) // (prev.extraEnv or {}); + STEAM_EXTRA_COMPAT_TOOLS_PATHS = makeSearchPathOutput "steamcompattool" "" cfg.extraCompatPackages; + }) // (prev.extraEnv or {}); extraLibraries = pkgs: let prevLibs = if prev ? extraLibraries then prev.extraLibraries pkgs else [ ]; additionalLibs = with config.hardware.opengl; @@ -74,10 +74,17 @@ in { extraCompatPackages = mkOption { type = types.listOf types.package; default = [ ]; + example = literalExpression '' + with pkgs; [ + proton-ge-bin + ] + ''; description = lib.mdDoc '' Extra packages to be used as compatibility tools for Steam on Linux. Packages will be included in the `STEAM_EXTRA_COMPAT_TOOLS_PATHS` environmental variable. For more information see - . + https://github.com/ValveSoftware/steam-for-linux/issues/6310. + + These packages must be Steam compatibility tools that have a `steamcompattool` output. ''; }; diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix new file mode 100644 index 000000000000..68e147ca4f9c --- /dev/null +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -0,0 +1,57 @@ +{ lib +, stdenvNoCC +, fetchzip +, writeScript +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "proton-ge-bin"; + version = "GE-Proton9-1"; + + src = fetchzip { + url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${finalAttrs.version}/${finalAttrs.version}.tar.gz"; + hash = "sha256-odpzRlzW7MJGRcorRNo784Rh97ssViO70/1azHRggf0="; + }; + + outputs = [ "out" "steamcompattool" ]; + + buildCommand = '' + runHook preBuild + + # Make it impossible to add to an environment. You should use the appropriate NixOS option. + # Also leave some breadcrumbs in the file. + echo "${finalAttrs.pname} should not be installed into environments. Please use programs.steam.extraCompatPackages instead." > $out + + ln -s $src $steamcompattool + + runHook postBuild + ''; + + /* + We use the created releases, and not the tags, for the update script as nix-update loads releases.atom + that contains both. Sometimes upstream pushes the tags but the Github releases don't get created due to + CI errors. Last time this happened was on 8-33, where a tag was created but no releases were created. + As of 2024-03-13, there have been no announcements indicating that the CI has been fixed, and thus + we avoid nix-update-script and use our own update script instead. + See: + */ + passthru.updateScript = writeScript "update-proton-ge" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl jq common-updater-scripts + repo="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases" + version="$(curl -sL "$repo" | jq 'map(select(.prerelease == false)) | .[0].tag_name' --raw-output)" + update-source-version proton-ge-bin "$version" + ''; + + meta = { + description = '' + Compatibility tool for Steam Play based on Wine and additional components. + + (This is intended for use in the `programs.steam.extraCompatPackages` option only.) + ''; + homepage = "https://github.com/GloriousEggroll/proton-ge-custom"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ NotAShelf shawn8901 ]; + platforms = [ "x86_64-linux" ]; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + }; +}) diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix index 9c68f241a7fe..4a1cdb93fc06 100644 --- a/pkgs/games/steam/fhsenv.nix +++ b/pkgs/games/steam/fhsenv.nix @@ -309,6 +309,7 @@ in buildFHSEnv rec { description = "Steam dependencies (dummy package, do not use)"; }; + passthru.steamargs = args; passthru.run = buildFHSEnv { name = "steam-run";