fix(xdg): order autostart apps after xdg-desktop-portal

At login the xdg-autostart-generator starts apps at
graphical-session.target, racing the portal user services. Sandboxed
apps (nixpak firefox/telegram) end up with broken FileChooser/OpenURI
until manually restarted.

Add a template drop-in on app-@autostart.service that makes every
autostart app wait for the portal stack.
This commit is contained in:
Ryan Yin
2026-08-15 00:47:59 +08:00
parent 88e916b63e
commit 495c366938
2 changed files with 23 additions and 1 deletions
+5 -1
View File
@@ -5,7 +5,11 @@
...
}:
{
# XDG autostart entries - ensures apps start after portal services are ready
# XDG autostart entries. All of them are globally ordered after the
# xdg-desktop-portal stack via `systemd.user.units."app-@autostart.service"`
# in modules/nixos/desktop/xdg.nix, so sandboxed apps (nixpak: firefox,
# telegram, ...) don't race the portal at login and end up with broken
# FileChooser/OpenURI until manually restarted.
xdg.autostart.enable = true;
# This fixes nixpak sandboxed apps (like firefox) accessing mapped folders correctly
xdg.autostart.entries = [