Desktop entries don't update when performing nixos-rebuild switch
after adding/removing derivations containing desktop items
#139999
Labels
0.kind: bug
Something is broken
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Describe the bug
When running
sudo nixos-rebuild switch
after adding or removing a system or home-manager package containing a freedesktop entry, the desktop (on GNOME 40 + Wayland at least) remains unaware of the change until logging out and logging back in again.Steps To Reproduce
.desktop
entry to yoursystemPackages
or home-manager packages.sudo nixos-rebuild switch
Expected behavior
If the set of desktop entries changes during a
nixos-rebuild switch
, the desktop environment's entries should be "refreshed" and be immediately aware of the new desktop entry.Additional context
I'm unsure if this is also the case on KDE desktops as I've only tested with GNOME 40.
I'm unsure if this is possible to achieve without a lot of fiddling. I imagine it is the Desktop Environment's responsibility to track desktop entries. As a result, I'd imagine the procedure would have to look something like this:
There are some suggestions on how to refresh desktop entries here:
https://unix.stackexchange.com/questions/12118/how-do-i-refresh-gnome-3-applications
Unfortunately many suggestions appear to be X11 specific. The only approach I've had success with so far on Wayland is logging out and back in again (not very convenient).
The Arch wiki suggests to run the following:
and a GNOME developer also suggests running
update-desktop-database
.The
update-desktop-database
tool is not present in the default NixOS GNOME setup, but can be installed via thedesktop-file-utils
package.The command appears to be aware of the necessary directories to check (e.g.
/nix/store/*/share/applications
) however it fails with a* could not be updated
error and complains that each of those directories are read-only. I'm not sure why the tool would require anything more than read-access, but either way it appears to fail to update the desktop entries when I run it locally.`update-desktop-database --verbose` output
I don't imagine this should be particularly high priority, but I've run into it enough times that I thought I'd open an issue!
Notify maintainers
GNOME team - @hedning @jtojnar @dasj19 @maxeaubrey sorry to bother! Any thoughts/ideas would be appreciated :)
Metadata
"x86_64-linux"
Linux 5.14.2, NixOS, 21.05.3065.b3083bc6933 (Okapi)
yes
yes
nix-env (Nix) 2.3.15
"nixos-21.05.3065.b3083bc6933"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: