From 7bd873e41447d7f961b21b5994626ec7c5329594 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 20 Sep 2026 02:11:58 +0800 Subject: [PATCH] fix(firefox): share MPRIS artwork, trash and host config paths The sandbox remaps XDG_DATA_HOME/XDG_CONFIG_HOME, so paths Firefox exposes to or shares with the host ended up isolated. Bind the MPRIS artwork dir and the real trash rw, and mimeapps.list, user-dirs.dirs and the shared NSS cert store ro. recently-used.xbel stays isolated: GTK writes it atomically, which a single-file rw bind would break. --- hardening/nixpaks/firefox.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hardening/nixpaks/firefox.nix b/hardening/nixpaks/firefox.nix index 7ce20b1b..ee018186 100644 --- a/hardening/nixpaks/firefox.nix +++ b/hardening/nixpaks/firefox.nix @@ -43,6 +43,15 @@ let # NOTE: sloth.mkdir is used to create the directory if it does not exist! (sloth.mkdir (sloth.concat' sloth.homeDir "/.mozilla")) + # MPRIS artwork: Firefox writes covers here and advertises the same + # path over MPRIS. Without this bind it lands under the sandboxed + # XDG_DATA_HOME and Noctalia (outside) cannot read it. + (sloth.mkdir (sloth.concat' sloth.homeDir "/.local/share/firefox-mpris")) + + # Files deleted from Firefox go to the real trash instead of a + # private one under the sandboxed XDG_DATA_HOME. + (sloth.mkdir (sloth.concat' sloth.homeDir "/.local/share/Trash")) + sloth.xdgDocumentsDir sloth.xdgDownloadDir sloth.xdgMusicDir @@ -62,6 +71,13 @@ let (sloth.concat' sloth.homeDir "/.local/share/password-store") # my secrets (sloth.concat' sloth.runtimeDir "/gnupg") # for access gpg-agent socket + # Match the host's default-app associations and XDG user dirs. + (sloth.concat' sloth.homeDir "/.config/mimeapps.list") + (sloth.concat' sloth.homeDir "/.config/user-dirs.dirs") + + # Shared NSS client-certificate store (imported outside Firefox). + (sloth.concat' sloth.homeDir "/.pki/nssdb") + # Unsure (sloth.concat' sloth.xdgConfigHome "/dconf") ];