about summary refs log tree commit diff
path: root/pkgs/games/steam
diff options
context:
space:
mode:
authorJeff Huffman <tejing@tejing.com>2023-12-09 00:29:32 -0500
committerJonathan Ringer <jonringer@users.noreply.github.com>2023-12-13 23:33:05 -0800
commit195248b6c101f3d58002d5c7e15be38231780786 (patch)
tree51fdbf4c680d5e01e5076d7fa6280a000d746146 /pkgs/games/steam
parent452b8162ecc995793d906cde424b652fa3dd1314 (diff)
buildFHSEnv, steam: isolate steam's /tmp from host
Works around steam's misbehavior: https://github.com/ValveSoftware/steam-for-linux/issues/9121
Diffstat (limited to 'pkgs/games/steam')
-rw-r--r--pkgs/games/steam/fhsenv.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix
index 8ba5087ef7fe7..0e4b5f3a8b29d 100644
--- a/pkgs/games/steam/fhsenv.nix
+++ b/pkgs/games/steam/fhsenv.nix
@@ -3,11 +3,12 @@
 , extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs
 , extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs
 , extraProfile ? "" # string to append to profile
-, extraBwrapArgs ? [ ] # extra arguments to pass to bubblewrap
+, extraPreBwrapCmds ? "" # extra commands to run before calling bubblewrap (real default is at usage site)
+, 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 ? true # include game specific libraries
-}:
+}@args:
 
 let
   commonTargetPkgs = pkgs: with pkgs; [
@@ -279,7 +280,17 @@ in buildFHSEnv rec {
     exec steam ${extraArgs} "$@"
   '';
 
-  inherit extraBwrapArgs;
+  # steamwebhelper deletes unrelated electron programs' singleton cookies from /tmp on startup:
+  # https://github.com/ValveSoftware/steam-for-linux/issues/9121
+  privateTmp = true;
+
+  extraPreBwrapCmds = ''
+    install -m 1777 -d /tmp/dumps
+  '' + args.extraPreBwrapCmds or "";
+
+  extraBwrapArgs = [
+    "--bind-try /tmp/dumps /tmp/dumps"
+  ] ++ args.extraBwrapArgs or [];
 
   meta =
     if steam != null