Configuring mimetypes declaratively was one thing I was super excited to do with nixos, since its historically always been the cause of a lot of loss of sanity with linux.
However, I noticed recently that if I install Flatpak, then every single url opens in the flatpak portal/opener instead, which completely ignores all of my file associations and mime types After investigating deeper, I noticed that in the source code for xdg-open the end of the switch will prioritise flatpak over the generic opener that uses mime types.
I assume this is the cause of the issue, but how do I fix this / why is this the default behavior? Iām running sway, so none of the DE openers trigger. Is it possible to make the flatpak opener use the mimeapps.list or make it skip that entirely?
The flatpak branch should only be called when xdg-open is executed from Flatpak app:
What do you mean by āevery single URLā? From which app and how are you you opening the links? Are you just calling xdg-open https://example.com in terminal emulator? Did you install it through Nix or Flatpak?
xdgOpenUsePortal seems like the culprit⦠but why would it ignore my mime type associations? The portal is necessary for flatpaks apps to be able to open links outside of flatpak, so Iām tempted to keep it.