Shortage of .desktop files

Hello all,

I have a load of applications that I’m installing via home.packages in home-manager. (I think) I have setup my xdg options correctly, so that these should have associated .desktop files (according to my reading of home-manager/xdg-mime.nix at 882bd8118bdbff3a6e53e5ced393932b351ce2f6 · nix-community/home-manager · GitHub ):

{
  xdg.mime.enable = true;
  xdg.mimeApps = {
    enable = true;
    defaultApplications = {
      "text/plain" = [ "kakoune.desktop" "nvim.desktop" "vim.desktop" ];
    };
  };
}

However, if i look at ls /home/chris/.nix-profile/share/applications then I see only a small subset of the .desktop files I would expect to see. This set also appears to be out-of-date (it has a couple of applications on that I’ve long since removed from my home.packages). Presumably for this reason, my defaultApplications setting is not working correctly, because it can’t find the applications that I’m trying to set as defaults. Is there some way I can force my system to update its generated .desktop files? Or is my expectation of home-manager’s behaviour wrong here?

Thanks for any help!

Chris