Having a little issue with adding or removing desktop entries

Using home-manager as a standalone module. At some point new desktop entries stopped appearing in XDG_DATA_DIRS, both, the one provided as part of a package and my custom one. Old desktop entries, for the removed packages, sits in XDG_DATA_DIRS.

For example a while back I had the bruno package installed through home packages,

λ lsd | rg bruno
/home/risus/.local/state/nix/profiles/home-manager/home-path/share/applications/bruno.desktop

~ 
λ whereis bruno
bruno:

λ stat /home/risus/.local/state/nix/profiles/home-manager/home-path/share/applications/bruno.desktop
  File: /home/risus/.local/state/nix/profiles/home-manager/home-path/share/applications/bruno.desktop -> /nix/store/dmcp9c46glfp2adfgajcwfkhhzy4xhpx-bruno-2.13.2/share/applications/bruno.desktop

(lsdmy little utility, prints all *.desktop files)

λ echo $env.XDG_DATA_DIRS
/home/risus/.local/share/flatpak/exports/share:/run/current-system/sw/share:/home/risus/.local/state/nix/profiles/home-manager/home-path/share:/home/risus/.local/share

xdg. scattered across my config files, wasn’t an issue before, here example nixos/home/modules/apps.nix at 8c5eed8f6cb1b74abc9b404a8ab848a04a980ee1 · Elbtalkessel/nixos · GitHub (I did try xdg.enable = true, didn’t help.)

xdg conf in system config nixos/system/modules/session.nix at 8c5eed8f6cb1b74abc9b404a8ab848a04a980ee1 · Elbtalkessel/nixos · GitHub nothing special.

I have a hard time understand what preventing home manager from creating xdg entries :frowning: misconfiguration? I’m re-reading xdg module documentation, but can’t find the reason, although after 2 years I don’t really understand nixos well, so likely the reason is extremely obvious

Thanks!

Are you sure home-manager is actually working correctly? To me it looks like you’re not using the generation you think you are; perhaps you’re using the NixOS module and are overlooking a switch error.

2 Likes

You are right

λ home-manager generations
2025-11-10 11:41 : id 855 -> /nix/store/7p0lbj4y28r7cjixhnhsic766mj8s7f3-home-manager-generation (current)

It did complain about several pathes without link to a home manager generations, but now, after switch, everything works. Likely I did indeed overlooked some warnings. Strange, 2025, seems very old. For example yesterday I added several user’s systemd services through HM and it worked, but not desktop entries.

Thank you for the help :slight_smile: you rock as always