Adding file access to an external snap

I’m kind-of new to snaps, only did installs and removes for the last year and now I’m ready to dive deeper. Is there a way to add external path maps to a snap that is pre-built or do I need to repackage it?

e.g. I installed the spotify snap, but I can’t give it a path outside /home/ to find my local mp3 library. Is there a way to edit the set of mounts/paths it can access, and have it also survive upgrades and all? (I did search around the docs and I am not seeing anything relevant other than maybe removing and reinstalling with --classic, if I correctly understand what that does)

The home interface allows you to access most regular files under your home directory, and the removable-media interface allows you to access regular files under /media/* and /run/media/*. The latter is not an auto-connect interface and you have to manually connect it.

So if I have a big RAID mounted on /blob/ my best option is to bind-mount it under my homedir as well?

Probably yes, since snapd have no idea where your data store is.

I understand. I was hoping it would be possible to add mounts at invocation somehow, like with docker. I get a standard docker image from the registry, and using the CLI or docker-compose I can add mounts without repacking the image.

1 Like