Set your environment variables, kids!

Just recording for posterity the solution to an incredibly stupid problem.
When I switched my users.users.<name>.shell = to the extremely nice fish shell, I neglected to add programs.fish.enable = true; in my configuration.nix.

This meant a few crucial environment variables were not set in my login shell (even though most were there!), one of which being a few entries in $GIO_EXTRA_MODULES relating to GVFS (mentioned here). This manifested in the file manager refusing to open the trash (“Sorry, could not display all the contents of trash:/// : Operation not supported”), mount sftp, automount USB drives, or show file metadata.

So don’t miss this step! Although it really should warn you.

Though the effect of pure functional builds in the maddening month of troubleshooting I went through is knowing reinstalling will have absolutely no effect, the problem is in your configuration.nix.

10 Likes

Thank you for this post!

This solved my problem mentioned in the Github issue :smiley: Thanks a lot!

1 Like

I use the default shell with my user and have this problem. Also, no available protocols for “Connect to Server”. Any suggestions?

Btw., I just discovered, that I can’t change nautilus preferences either.

Look at this: [20.03] Nautilus unable to open GVFS paths · Issue #89542 · NixOS/nixpkgs · GitHub
The issue is that GVFS modules are missing from the GIO_EXTRA_MODULES environment variable, you might look at that.

Hey thank you so much for taking the time to post this! I had included fish in my list of packages but was still using bash as my default shell. Finally decided to bite the bullet (and got sick of having to start fish after opening a terminal) and set fish as my default shell. Everything seemed to work fine. I didn’t notice the issue with Nautilus for quite a while. And it didn’t even occur to me that a UI file browser issue could be due to my choice of default shell! But after adding programs.fish.enable = true; in my config, the “other locations” functionality is working great!

i had set programs.zsh.enable = true; but was missing services.gvfs.enable = true; (not knowing what GVFS was or why i’d need it)