NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.17k forks source link

xdg-user-dirs-gtk should be a dependency of nautilus #346054

Open coreyberla opened 1 month ago

coreyberla commented 1 month ago

Describe the bug

From what I can tell xdg-user-dirs-gtk isn't required for nautilus, it should be. If possible it would be great if it was installed as early as possible.

See commit https://gitlab.gnome.org/GNOME/nautilus/-/commit/444c8a59aed6bb4f068ca51811b3b8c81eb31134 copy/paste below:

Nautilus has quasi-depended on xdg-user-dirs-gtk, but it has largely gone unnoticed. That is, until commit 5c2f5566 ("placessidebar: Reorganize places"), which makes this dependency very obvious. Along with updating localization, xdg-user-dirs-gtk also creates the default bookmarks. Now that we are treating the XDG locations as regular bookmarks it's critical that the user has xdg-user-dirs-gtk installed to create the default bookmarks. Ideally, the dependency would be installed as part of the base install to ensure that it is executed before the bookmark file is created elsewhere, but that's out of our control.

Notify maintainers

@jtojnar

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a :+1: reaction to issues you find important.

jtojnar commented 1 month ago

Thanks for the heads-up. I actually saw the discussion in #gnome-hackers about it but forgot to make a note.

We currently install x-u-d as a part of GNOME module. But modules are a separate higher-level layer above packages so it will not be present if someone installs Nautilus manually. In fact we are aware of the requirement thanks to bug reports about missing sidebar entries from users who installed it that way. Using Nautilus outside of GNOME is quite common among NixOS users.

Unfortunately, Nix does not have a good way of expressing global dependencies (e.g. systemd, D-Bus service or, in this case, autostart file). Actually, thanks to its store model, Nix allows running programs without needing to install them at all. Though, that means there is not much Nix can do, other than have nix run validate declared runtime dependencies – it would be undesirable, if it installed stuff globally behind user’s back.

In the short term, we might want to add a Nautilus NixOS module. Generally, NixOS users will install a package through a module if one is available and we already want it to simplify installation of extensions. But that will not help users of Nautilus Nix package outside of NixOS so for that, we will need to come up with a protocol to declare global dependencies and modify Nix to verify them on nix run.

bobby285271 commented 1 month ago

For the record x-u-d-gtk is packaged as part of GNOME 47 bump (though the status quo is the same as https://github.com/NixOS/nixpkgs/issues/346054#issuecomment-2390693111)