I believe nix-env
has symlinked that to ~/.nix-profile/share/applications
. If you set XDG_DATA_DIRS="$XDG_DATA_DIRS:~/.nix-profile/share"
in your env vars early enough for gnome to notice these kinds of things should just work.
That said, once you’ve made it past initial experimentation and want to use nix as a serious package manager, I’d recommend switching away from nix-env
and using something like home-manager. That would then also solve little integration problems like this.
nix-env
has many serious issues that make it problematic as a package manager in the long run, you really need a more user friendly layer (like home-manager) on top to make it not be a footgun.