I installed NixOS a few days ago and I use Sway as my WM. The big problem is that every application has a really long startup time.
Take Nautilus (GNOME File Manager) as an example. It takes ~30-40 seconds to start. Same goes for Firefox, Steam, and pretty much every other program I have installed. This also is the case for flatpak applications.
I suspect it has something to do with the xdg-desktop-portal.
Do you have a persistent .cache/mesa_shader_cache/ directory? Programs require shaders compiling at first start, it can take a while (but certainly not so much time, but this would depend of your specs)
That’s not a real product But it doesn’t matter; I was mostly asking in case you were running on either very weird or very old hardware. If that’s not the case then it’s very odd to have this problem.
I removed xdg-desktop-portal-gnome.
I now don’t have a desktop portal for GNOME apps (Nautilus, etc.) but applications start as expected. This is kind of weird, because using both desktop portals on Arch worked just fine for me. I will definitely look further into this.
Thank y’all for your replies.
I have the exact same issue as op, but I have a much simpler setup. I know sway can work well on this same machine because it did so before I reinstalled with a much simpler set of configs. Where before I had lots of stuff pulled in from gnome manually. This has simplified the config and everything works, except that every single app, including the terminal, takes at least 30 seconds to open. I now just have
Unfortunately I never found a fix for this problem and after encountering more issues (like Steam games not working correctly) I moved away from NixOS as my desktop operating system. I still love the build system and NixOS is still my linux distro of choice for servers.
Did anybody find a solution to this? I am running NixOS+Hyprland on a laptop with Intel iGPU+NVIDIA dGPU and I often need to wait 3–5 seconds for a terminal (alacritty/kitty) window to launch. After the initial launch, second and third window launches etc. are fine but every once in a while when I want to launch a new window after some time the first terminal window takes inconsistently and annoyingly a long time. I have xdg-desktop-portal-hyprland and xdg-desktop-portal-gtk installed.
Did you started dbus before starting your portals ? I had same problem and I have added the following to my hyprland config :
###Start dbus ###
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
### kill active portals and restart them ###
exec-once = $scriptsDir/PortalHyprland-NixOS.sh
The script to restart the portals Is here:
#!/run/current-system/sw/bin/bash
# Find all portals executables actually running
portal_list=$(ps -fu bt|grep xdg-desktop-portal|grep -v grep|sort|awk -F " " '{print $8}')
for portal in $portal_list; do
# Get the name of executable
portal_name=$(basename -- "$portal")
# Check if the executable is valid and exists
if [ -x "$portal" ]; then
# Kill the active one and restart it
killall "$portal_name"
sleep 1
"$portal" &
exit 0
fi
done
# If no valid executable is found, report an error
echo "No valid xdg-portal-desktop found"
exit
The script could be improved, but it works for me. I have absolutely no delay after launching any apps.
I’m having the same issue.
I reinstalled nixos because I was trying out bazzite for a while.
Before the reinstall everything worked fine. Now with the exact same config I run into this problem.
My gnome config is also relatively simple like @senorsmile
The issue went away when I upgraded to 23.11. I haven’t experienced anything like it since. I don’t know if this is of any help, but these are some of the additional things I’ve added at some point in the last year that are possibly related:
Thanks for the quick reply! Much appreciated. I have most of that stuff (minus sway) set already.
No idea why this is happening now when it was working before. Welp…
When I had the issue, it was specifically a problem inside of sway when gnome/gdm were installed. If I removed them and logged into sway manually, the issue went away. If I logged directly into gnome (which I would never use; I just install it to get all the goodies it comes with by default, and as a backup), apps would not see the slow down.
So, it’s possible that whatever you’re experiencing now is in fact different than the bug previously mentioned which seems to have been resolved.
Most likely, yeah. I switched back to bazzite for now. Everything just works on that distro. But I drank the nixos kool aid. I know I will be back at some point. Maybe it will be resolved by then.