Files disappear when moved to unavailable trash of Nautilus

Use GNOME Files (Nautilus) independently with Hyprland. The trash functionality is unavailable by default (showing “operation not supported”), but the “Move to Trash” button in right-click menu can still be triggered, resulting in that the file just disappears. Where does it go?

You can enable the virtual file system module responsible for trash with services.gvfs.enable = true; NixOS option. Note that you will need to re-log in since the module sets environment variable.

Deleted files from the partition containing your home directory will typically end up under ~/.local/share/Trash – the files themselves will go to files subdirectory and the metadata (e.g. original location) will go to info. On other partitions the directory is .Trash in the root of partition.

Thanks. It works well. By the way, accroding to ArchWiki, there is some mount functionality shipped with Gvfs, which should be enabled by running Files as a daemon or using an additional utility. Is it necessary if I just want to use the trash functionality?

If you are referring to File manager daemon, that section is quite confusingly written. I doubt most desktop environments will start file manager in daemon mode, GNOME certainly does not do that for Nautilus. Nautilus will continue to hang around in the background for ~15 seconds after the last window is closed to avoid startup cost in case a new window is opened shortly after but that’s it for running in background. The relevant section is the Standalone mount application, which is the role of GVfs daemon.

If you really want, you can rebuild gvfs with most of its backends disabled with the services.gvfs.package NixOS option using something lke the following (untested):

services.gvfs.package = (pkgs.gnome.gvfs.override {
  # Disable some optional features
  # See
  udevSupport = false;
  gnomeSupport = false;
  avahi = null;
  samba = null;
}).overrideAttrs (attrs: {
  mesonFlags = attrs.mesonFlags ++ [
    # Disable some more services.
    # For available options see
    # See gvfs(7) for info about various daemons provided
    # Maybe some more are needed.