Compare commits

..

2 Commits

Author SHA1 Message Date
daniil-berg 46cebeb8fd 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>
2026-07-07 13:56:41 +02:00
daniil-berg f35037387c feat(desktop): run Chromium/Electron apps natively on Wayland
Set NIXOS_OZONE_WL=1 so nixpkgs' chromium/electron wrappers inject the
Ozone Wayland flags. This is a Wayland-only session, so the XWayland
fallback is pure downside (blurry fractional scaling, extra hop).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 13:56:05 +02:00
2 changed files with 26 additions and 1 deletions
+22
View File
@@ -52,6 +52,12 @@ in
# Mute the harmless "Wayland does not support QWindow::requestActivate()"
# spam Qt apps (keepassxc) print; scoped to that one log category only.
QT_LOGGING_RULES = "qt.qpa.wayland=false";
# Run Chromium/Electron apps (brave, signal, grayjay's webview) natively on
# Wayland instead of XWayland: nixpkgs' chromium/electron wrappers read this
# and inject the Ozone Wayland flags. This is a Wayland-only (Hyprland)
# session, so XWayland is pure downside (blurry fractional scaling, extra
# hop). Override per-app with --ozone-platform=x11 if one misbehaves.
NIXOS_OZONE_WL = "1";
# GUI helper for ssh passphrase/PIN prompts (see sshAskpass above). Not
# forced: with a tty ssh still prompts inline; the helper is used only when a
# caller sets SSH_ASKPASS_REQUIRE (e.g. a headless/agent context).
@@ -282,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
View File
@@ -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 ];