From aa070a5d9a9d217c186a172fc44877992c5c5542 Mon Sep 17 00:00:00 2001 From: Jeff Huffman Date: Thu, 21 Dec 2023 11:25:21 -0500 Subject: [PATCH 1/2] buildFHSEnv: fix privateTmp for sddm --- pkgs/build-support/build-fhsenv-bubblewrap/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index 7d0138a4d85a..e13288371b5d 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -187,6 +187,12 @@ let x11_args+=(--ro-bind-try "$local_socket" "$local_socket") fi + ${lib.optionalString privateTmp '' + # sddm places XAUTHORITY in /tmp + if [[ "$XAUTHORITY" == /tmp/* ]]; then + x11_args+=(--ro-bind-try "$XAUTHORITY" "$XAUTHORITY") + fi''} + cmd=( ${bubblewrap}/bin/bwrap --dev-bind /dev /dev From 25c947b3fc7b219e8ce3302b35d868194c57a20f Mon Sep 17 00:00:00 2001 From: Jeff Huffman Date: Thu, 21 Dec 2023 11:35:33 -0500 Subject: [PATCH 2/2] steam: make privateTmp overrideable --- pkgs/games/steam/fhsenv.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix index 7bcc7976f1f9..d5b266cece37 100644 --- a/pkgs/games/steam/fhsenv.nix +++ b/pkgs/games/steam/fhsenv.nix @@ -7,6 +7,11 @@ , 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 + +# steamwebhelper deletes unrelated electron programs' singleton cookies from /tmp on startup: +# https://github.com/ValveSoftware/steam-for-linux/issues/9121 +, privateTmp ? true # Whether to separate steam's /tmp from the host system + , withGameSpecificLibraries ? true # include game specific libraries }@args: @@ -285,9 +290,7 @@ in buildFHSEnv rec { exec steam ${extraArgs} "$@" ''; - # steamwebhelper deletes unrelated electron programs' singleton cookies from /tmp on startup: - # https://github.com/ValveSoftware/steam-for-linux/issues/9121 - privateTmp = true; + inherit privateTmp; extraPreBwrapCmds = '' install -m 1777 -d /tmp/dumps