about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-01-09 22:42:37 +0300
committerK900 <me@0upti.me>2024-01-09 22:42:37 +0300
commit838aefefc3ff5e4c8e29efe98cd38284d179d98a (patch)
treedb9d4b01f4c58b9e062386edbf91c3351903f999 /pkgs/build-support
parentd8364a95c7048af5d4036f1bc1d03d448a8bb017 (diff)
parent8736250fc2dd54702e7d53936b672e20f44fc9d1 (diff)
downloadnixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar.gz
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar.bz2
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar.lz
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar.xz
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.tar.zst
nixlib-838aefefc3ff5e4c8e29efe98cd38284d179d98a.zip
Merge remote-tracking branch 'origin/master' into staging-next
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-fhsenv-bubblewrap/default.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
index e13288371b5d..3292f4039a63 100644
--- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
+++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
@@ -191,7 +191,21 @@ let
     # sddm places XAUTHORITY in /tmp
     if [[ "$XAUTHORITY" == /tmp/* ]]; then
       x11_args+=(--ro-bind-try "$XAUTHORITY" "$XAUTHORITY")
-    fi''}
+    fi
+
+    # dbus-run-session puts the socket in /tmp
+    IFS=";" read -ra addrs <<<"$DBUS_SESSION_BUS_ADDRESS"
+    for addr in "''${addrs[@]}"; do
+      [[ "$addr" == unix:* ]] || continue
+      IFS="," read -ra parts <<<"''${addr#unix:}"
+      for part in "''${parts[@]}"; do
+        printf -v part '%s' "''${part//\\/\\\\}"
+        printf -v part '%b' "''${part//%/\\x}"
+        [[ "$part" == path=/tmp/* ]] || continue
+        x11_args+=(--ro-bind-try "''${part#path=}" "''${part#path=}")
+      done
+    done
+    ''}
 
     cmd=(
       ${bubblewrap}/bin/bwrap