nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.03k stars 77 forks source link

Add `hideMounts` option to Home Manager module #127

Open Anomalocaridid opened 1 year ago

Anomalocaridid commented 1 year ago

Currently, it does not look like the hideMounts option in the NixOS module applies to mounts created with the Home Manager. However, I also cannot find any equivalent option in the Home Manager module.

nklsfrt commented 7 months ago

Just to give you some insight on why I assume this isn't a thing yet:

As you can see here, system level mounts are generated and placed in /etc/fstab as bind mounts (via mount --bind) and supplied with the x-gvfs-hide mount option. This option is saved to user-space and informs the user interface to hide the device from all places it would show up in.

Since mounts happening in user-space lack the privileges required to execute the mount command, they make use of the FUSE implementation of bind mounts called bindfs. AFAIK this simply doesn't support the x-gvfs-hide mount option.