about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2024-03-14 23:54:02 +0100
committerAtemu <atemu.main@gmail.com>2024-03-16 17:59:27 +0100
commit2b619c23146b7b791ed25a174add5cc8d99c8654 (patch)
treef01f879e2a0211f0a3e145627c764dc8fe13d306
parent1b42f2ffbf5c12044b9792a77f5828f6877ccae1 (diff)
downloadnixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar.gz
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar.bz2
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar.lz
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar.xz
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.tar.zst
nixlib-2b619c23146b7b791ed25a174add5cc8d99c8654.zip
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.
-rw-r--r--nixos/modules/programs/steam.nix8
-rw-r--r--pkgs/by-name/pr/proton-ge-bin/package.nix12
2 files changed, 11 insertions, 9 deletions
diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix
index 31803f061dce..8fc0f35c0dce 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;
@@ -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.
       '';
     };
 
diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix
index 1002a549cbcd..c64723a6b5a4 100644
--- a/pkgs/by-name/pr/proton-ge-bin/package.nix
+++ b/pkgs/by-name/pr/proton-ge-bin/package.nix
@@ -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
   '';