Dolphin - File associations

On non plasma systems (wayfire), mainly on nixos. How do you get dolphin to play nice with mime types and file associations? When trying to open anything it brings up the prompt but its empty. You can type in the name if you know it, but it wont remember even if you check the box.

Arch kinda had a fix for this at one time Dolphin - ArchWiki but it only works there.

I’ve tried running kbuildsycoca6 but nothing.

kbuildsycoca6 running...
"applications.menu"  not found in  QList("/etc/profiles/per-user/elitewf/etc/xdg/menus", "/run/current-system/sw/etc/xdg/menus")

I can manually make the path in .config and the command will run but will not change anything in dolphin.

Also tried adding, to my configuration.nix

xdg.mime.enable = true;
xdg.menus.enable = true;
xdg.portal.enable = true;
xdg.portal.xdgOpenUsePortal = true
pkgs.kdePackages.xdg-desktop-portal-kde
pkgs.kdePackages.kservice

Someone on the nix github came though with a work around

This one-liner fixed it for me:

environment.etc."xdg/menus/applications.menu".source = "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";

Don’t forget to nixos-rebuild switch and kbuildsycoca6.

Adding it you your config fixes it only tested on wayfire but i bet it works on others.