nixos/steam: use steamcompattool output for extraCompatPackages

This sets a standard for Steam compat tools in NixOS where they must have the
compat tool in a special steamcompattool output.

proton-ge-bin was adjusted to conform with it.
This commit is contained in:
Atemu 2024-03-14 23:54:02 +01:00
parent 1b42f2ffbf
commit 2b619c2314
2 changed files with 11 additions and 9 deletions

View File

@ -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;
@ -77,7 +77,9 @@ in {
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">.
https://github.com/ValveSoftware/steam-for-linux/issues/6310.
These packages must be Steam compatibility tools that have a `steamcompattool` output.
'';
};

View File

@ -12,14 +12,14 @@ stdenvNoCC.mkDerivation (finalAttrs: {
hash = "sha256-wCIffeayOy3kEwmIKB7e+NrliuSpKXoVYC334fxVB3U=";
};
outputs = [ "out" "steamcompattool" ];
buildCommand = ''
runHook preBuild
mkdir -p $out/{bin,opt}
tar -C $out/opt --strip=1 -x -f $src
ln -s $out/opt/toolmanifest.vdf $out/bin/toolmanifest.vdf
install -Dm644 $out/opt/compatibilitytool.vdf $out/bin/compatibilitytool.vdf
substituteInPlace $out/bin/compatibilitytool.vdf \
--replace-fail '"install_path" "."' '"install_path" "${placeholder "out"}/opt"'
mkdir -p $out $steamcompattool
tar -C $steamcompattool --strip=1 -x -f $src
runHook postBuild
'';