Required Nix Gnome Tweaks/Hacks

I’m using Nix on Silverblue. I’m having trouble tracking down how to make Gnome play nicely with Nix.

  • I need to re-log to see newly installed packages in Gnome Activities
  • Many apps (VSCodium being one example) don’t merge with the correct launcher icon:

Is there a patch in nixpkgs to make Gnome Nix-aware?

This is the same issue as Gnome Activities icons should appear on app install · Issue #12757 · NixOS/nixpkgs · GitHub and unfortunately this is a GLib limitation so not really something you can fix yourself. We would need to report the issue with GLib, have someone fix it there, and then you would have to wait for Silverblue to update to a GLib version containing the fix.

Nix adds /home/jtojnar/.nix-profile/share to XDG_DATA_DIRS and then has a symlink chain like this /home/jtojnar/.nix-profile/nix/var/nix/profiles/per-user/jtojnar/profileprofile-109-link. When you install a package with nix-env, the /nix/var/nix/profiles/per-user/jtojnar/profile symlink will be updated to profile-110-link.

I suspect that when GLib starts monitoring the directories in XDG_DATA_DIRS, the inotify mechanism will resolve the symlinks so it will end up monitoring the immutable /nix/var/nix/profiles/per-user/jtojnar/profile-109-link.

https://github.com/NixOS/nixpkgs/pull/118100