Easy configuration/customization for a snap

I’d like to make a snap that I can use on a Raspberry Pi that would automatically internet-broadcast audio coming in from a USB audio interface. After the brief embarrassment of a bad idea, I think I’ve resolved to attempt to pull together mpd, darkice, and icecast2 to get data streaming locally (mostly for debugging purposes) and out to SHOUTcast.

I’m want to try making this a snap because I think this could be nice to package up and share, but I’m a little conceptually hung up on configuration.

If I did share this, I’d like folks to be able to set this up as easily as possible. I envision this looking like maybe a YAML file with the needed credentials and information for the user’s SHOUTcast account (information which needs to get into one of the config XMLs for things to work).

What’s a good way to snap this all together but provide the ability to get per-instance configuration in place.

You would have to create a configure hook for your snap to set options your app can then read from some configuration file or some such … i have been searching our documentation but it actually seems like this is undocumented yet.


and
https://docs.ubuntu.com/core/en/guides/build-device/config-hooks

migth be of interest for you here …

1 Like

Here, this blog post about the configure hook might prove helpful:

http://bit.ly/2f1Afkl

1 Like