particle-os-modules/modules/default-flatpaks/v1
xyny a639f1f64f
refactor(default-flatpaks): version 2 (nushell) (#336)
* feat: initial draft of default-flatpaks v2

this version just sets up the config file but nothing to read it and install the flatpaks after boot

* chore: streamline logging

* chore: replace json with yaml as generated config format

* feat: set up groundwork for post boot scripts

* feat: rename installations -> configurations, initial implementation of post-boot part

* fix: put executable files into /usr/libexec/

* fix: improve fedora remote detection and removal

* feat: implement notifications for system flatpak setup

* chore(default-flatpaks): No need to expose `DISPLAY` for notify-send

* chore(default-flatpaks): Update service & add timers to match v1

* chore(default-flatpaks): Copy & enable timers instead of services

* chore(default-flatpaks): Fix typo for copying `user-flatpak-setup` timer

* chore(default-flatpaks): Copy post-boot files directly instead of placing them in `/usr/share/...`

* chore(default-flatpaks): Forgot to remove copying step of post-boot files to `/usr/share/...`

* chore: update to be in accordance with cli support for nushell

* feat: allow usage of fedora flatpak remote, remove fedora flatpaks and runtimes

* feat: refactor schema to support multiple versions of the module

* docs: separate docs for separate module versions

* fix: copy user-flatpak-setup.timer to correct directory

* chore: correctly document default values in schema

* fix: better flathub package checking
- use API url
- check everything before erroring out

* feat: warn users when giving this module v1 configuration

* fix: prevent addition of http get result into unavailablePackages list

* fix: mkdir before cp

* chore: fix () semantics problems highlighted by debugger

* feat: bluebuild-flatpak-manager CLI

* feat: alert user when trying to use module with old configuration

* docs: write basic documentation page and rewrite example

* fix: attempt to use configFile variable without dollar sign

* fix: no such things as .configurations
(the file is the array)

* fix: ensure no empty list is printed

* docs: add a quick note about learning to use the flatpak manager tool

* fix(schema): distinquish between versions

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>

* fix: add noninteractive flag to flatpak install commands

* fix: ensure repo to be used is enabled

* chore: ignore errors in notify wrapper just in case

* chore: add link to announcement

* docs: run through languagetool

---------

Co-authored-by: fiftydinar <65243233+fiftydinar@users.noreply.github.com>
Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2025-07-26 14:09:39 +00:00
..
config feat: support versioning modules (#240) 2024-08-11 11:20:10 +00:00
user-config feat: support versioning modules (#240) 2024-08-11 11:20:10 +00:00
default-flatpaks.sh Use api for flathub app id check to reduce build fails and speedup builds (#387) 2025-02-14 11:39:10 +01:00
README.md refactor(default-flatpaks): version 2 (nushell) (#336) 2025-07-26 14:09:39 +00:00
system-flatpak-setup chore(default-flatpaks): Don't quit Gnome Software if it's not installed & adjust fedora-third-party messaging 2025-05-16 13:24:56 +02:00
system-flatpak-setup.service chore(default-flatpaks): Temporarily remove auto-restart of services (#355) 2024-10-28 12:40:20 +01:00
system-flatpak-setup.timer fix(default-flatpaks): Make notifications be more reliable by delaying service start for 30s & cleaner internet-related logs 2024-10-25 19:13:53 +02:00
user-flatpak-setup chore: Remove usage of yq in favor of jq (#369) 2024-12-02 19:02:13 +00:00
user-flatpak-setup.service chore(default-flatpaks): Temporarily remove auto-restart of services (#355) 2024-10-28 12:40:20 +01:00
user-flatpak-setup.timer fix(default-flatpaks): Make notifications be more reliable by delaying service start for 30s & cleaner internet-related logs 2024-10-25 19:13:53 +02:00

default-flatpaks

The default-flatpaks module can be used to install or uninstall Flatpaks from a configurable remote on every boot. It skips that operation if no changes are detected. This module, first removes the Fedora Flatpaks remote and Flatpaks that come pre-installed in Fedora (unless Fedora remote is strictly specified in recipe). A Flatpak remote is configured the first time the module is used, but it can be re-configured in subsequent usages of the module. If no Flatpak remote is specified, the module will default to using Flathub.

Flatpaks can either be installed system-wide or per-user. Per-user Flatpaks will be installed separately for every user on a system. Previously-installed flatpaks can also be removed.

The module uses the following scripts to handle flatpak setup:

  • /usr/bin/system-flatpak-setup
  • /usr/bin/user-flatpak-setup

The scripts are run on every boot by these services:

  • /usr/lib/systemd/system/system-flatpak-setup.service
  • /usr/lib/systemd/user/user-flatpak-setup-service

system-flatpak-setup uninstalls Fedora flatpaks, replaces Fedora repos with your repo choice, checks the Flatpak install/remove lists created by the module & performs the install/uninstall operation according to that. user-flatpak-setup does the same thing for user Flatpaks.

This module stores the Flatpak remote configuration and Flatpak install/remove lists in /usr/share/bluebuild/default-flatpaks/. There are two subdirectories, user and system corresponding with the install level of the Flatpaks and repositories. Each directory has text files containing the IDs of flatpaks to install and remove, plus a repo-info.yml containing the details of the Flatpak repository.

This module also supports disabling & enabling notifications. If not specified in the recipe, notifications are disabled by default.

If you wish to continue the use of Fedora flatpak remote & it's installed apps on booted system, you just need to specify the remote in the recipe (repo-name: fedora + repo-url: oci+https://registry.fedoraproject.org) & remote + all apps won't be removed (note that only fedora remote is supported, while fedora-testing isn't). When you do that, you can further customize flatpaks you want to install or remove from Fedora flatpak remote.

Local modification

If a local user is not satisfied with default Flatpak installations and removals in the image, it is possible for them to make modifications to the default configuration through the configuration files located within this directory:

/etc/bluebuild/default-flatpaks/

Folder structure is the same as talked about above, with system & user folders, install & remove files containing explanation on how those should be modified & what they do. The notifications file also contains this explanation for turning notifications on or off.

Known issues

Multiple repos inclusion is currently not supported (planned to implement in the future):
https://github.com/blue-build/modules/issues/146

Flatpak runtimes are not supported due to technical difficulty in implementing those:
https://github.com/blue-build/modules/pull/142#issuecomment-1962458757