fix(desktop): add GTK portal so file dialogs work
Home-manager's Hyprland module enables `xdg.portal` and pins the portal search dir to the user profile with only the Hyprland backend, which has no FileChooser implementation. File dialogs in Chromium/Electron apps (signal, brave) fail with a DBus "No such interface org.freedesktop.portal.FileChooser" error. Add `xdg-desktop-portal-gtk` at the home-manager layer (system-level extraPortals aren't in the pinned dir) and route FileChooser to it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -288,6 +288,22 @@ in
|
||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
};
|
||||
|
||||
# The home-manager Hyprland module below enables xdg.portal and pins the
|
||||
# portal search dir (NIX_XDG_DESKTOP_PORTAL_DIR) to this user profile, adding
|
||||
# only the Hyprland backend — which implements Screenshot/ScreenCast/
|
||||
# GlobalShortcuts but not FileChooser. Add the GTK portal here (system-level
|
||||
# extraPortals aren't in the pinned dir, so they're never seen) and route
|
||||
# FileChooser to it, else file dialogs in Chromium/Electron apps (signal,
|
||||
# brave) fail with a DBus "No such interface
|
||||
# org.freedesktop.portal.FileChooser" error.
|
||||
xdg.portal = {
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common = {
|
||||
default = [ "hyprland" "gtk" ];
|
||||
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
configType = "hyprlang";
|
||||
|
||||
+4
-1
@@ -96,7 +96,10 @@
|
||||
# so the Secret Service is open without a second passphrase.
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
|
||||
# XDG portals (screen sharing, file pickers, and so on).
|
||||
# XDG portals (screen sharing, file pickers, and so on). The GTK portal (for
|
||||
# file dialogs) is added at the home-manager layer, not here: home-manager's
|
||||
# Hyprland module pins the portal search dir to the user profile, so a portal
|
||||
# listed in this system-level extraPortals is never seen. See modules/home.nix.
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
|
||||
|
||||
Reference in New Issue
Block a user