Skip to content

Commit

Permalink
fix(nixos): issue with systemd xdg-desktop-portal-gtk missing vars
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Dec 27, 2024
1 parent 39ba126 commit 1fc6f18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nix/nixos/sway/config
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,16 @@ for_window [class="^.*$"] focus
# Inhibit swayidle when watching videos on fullscreen
for_window [class="^.*"] inhibit_idle fullscreen

### Start auxiliar services
#
# Start blueman-applet
# Since it depends on $DISPLAY it must be started after sway
exec zsh -c "blueman-applet &"

# Autotiling for sway
# To make the UX a bit more like yabai
exec_always autotiling -w 1 3 5 7 9 -sr 1.61

## FIX for nixos after 24.11 that makes xdg-desktop-portal-gtk not work
# This caused any application that depends on gtk to take 20s to open, like dolphin
exec systemctl --user import-environment \
DISPLAY \
WAYLAND_DISPLAY \
XDG_SESSION_TYPE \
XDG_CURRENT_DESKTOP &

include @sysconfdir@/sway/config.d/*
12 changes: 12 additions & 0 deletions nix/nixos/windows-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
];
};

## NOTE On Nixos 24.11, there was an issue with loading xdg-desktop-portal-gtk
# which failed to load on demand, because of missing "DISPLAY" variable.
# This caused applications to take up to 20 seconds to load.
# See sway/config:412 for extra configuration to fix this issue.
xdg.portal = {
enable = true;

# Expected by xdg-desktop-portal
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};

# Allow applying the same settings to outside of X11
console.useXkbConfig = true;

Expand Down

0 comments on commit 1fc6f18

Please sign in to comment.