diff --git a/modules/home.nix b/modules/home.nix index a4b0891..3df407d 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -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"; diff --git a/modules/nixos.nix b/modules/nixos.nix index babfb31..85d8006 100644 --- a/modules/nixos.nix +++ b/modules/nixos.nix @@ -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 ];