blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
23 stars 25 forks source link

fix(default-flatpaks): Install & uninstall flatpaks on every boot #83

Closed fiftydinar closed 6 months ago

fiftydinar commented 7 months ago

This allows us to ditch the state file concept, which only allows us to run flatpak-setup once. After that, you need to manually delete the state file (system & user-flatpak-configured) if you want to have new changes from flatpak-setup.

This is not ideal.

We do not have the luxury of Bazzite, which allows you to change the version of the setup in setup service to automatically start it again (that's what they do).

Instead, we will install & uninstall only those flatpaks which are not on the list, ditching the need to have version checking (Thanks to @EyeCantCU for changes).

When there are no updates, flatpak-setup service automatically skips that process & exits.

The only process that always runs without skipping on every boot is adding flatpak remote & changing repository title if you did that in recipe.

Take a note that adding flatpak remote has --if-not-exists flag, so it does nothing if your repo stays the same. If you decide to change the repo name or repo link to new one again, currently, you will have to delete the old repo manually yourself. Changing repo title overwrites always (which means you can change repo title any time without worrying about above stuff).

I incorporated some shell formatting fixes, thanks to shellcheck.net.