sindresorhus / trash

Move files and directories to the trash
MIT License
2.57k stars 78 forks source link

Doesn't find correct Trash folder on NixOS #95

Open johnpyp opened 4 years ago

johnpyp commented 4 years ago

I've been trying to use trash via coc-explorer, but it doesn't seem to find the the correct Trash folder. I've investigated xdgTrashdir a bit to see if it was the cause, but xdgTrashdir() with no arguments seems to find my home trash dir fine (/home/$USER/.local/share/Trash).

The issue here is that according to trash my Trash folder is supposed to be /nix/store/.Trash-1000, which is not correct. NixOS uses a weird filesystem, and I'm not too familiar with why this is happening, but my best guess is that the mount mapping logic finds /nix/store as the mount the target directory $topdir according to the spec.

This is not the expected behavior, as /nix/store resides on the same filesystem and mount that my home folder does. I'm not familiar with how the mount points are resolved, so I'm not sure exactly how to fix this, but I'd gladly help with anything else I can do.