From 30931ed9c28055774c599be81c41c6855437e2d9 Mon Sep 17 00:00:00 2001 From: zelikos Date: Sat, 14 Oct 2023 11:43:13 -0400 Subject: [PATCH] fix: Use Flathub as default remote for default-flatpaks --- modules/default-flatpaks/README.md | 2 ++ modules/default-flatpaks/default-flatpaks.sh | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/modules/default-flatpaks/README.md b/modules/default-flatpaks/README.md index 490b72e..595ae00 100644 --- a/modules/default-flatpaks/README.md +++ b/modules/default-flatpaks/README.md @@ -2,6 +2,8 @@ The `default-flatpaks` module removes the Fedora Flatpaks remote that comes pre-installed by Fedora, and can be used to install flatpaks from a configurable remote on first boot. Flatpaks can either be installed system-wide or per-user, though per-user flatpaks will be installed for every user on a system. Previously-installed flatpaks can also be removed. +If no Flatpak remote is specified, the module will default to using Flathub. + The module uses the following scripts to handle flatpak setup: - `/usr/bin/system-flatpak-setup` diff --git a/modules/default-flatpaks/default-flatpaks.sh b/modules/default-flatpaks/default-flatpaks.sh index b4abdb1..d65fec7 100644 --- a/modules/default-flatpaks/default-flatpaks.sh +++ b/modules/default-flatpaks/default-flatpaks.sh @@ -23,6 +23,17 @@ configure_flatpak_repo () { repo_name=$(echo "$1" | yq -I=0 ".$2.repo-name") repo_title=$(echo "$1" | yq -I=0 ".$2.repo-title") + # Use Flathub as default repo + if [[ $repo_url == "null" ]]; then + repo_url=https://dl.flathub.org/repo/flathub.flatpakrepo + fi + + # If repo-name isn't configured, use flathub as fallback + # Checked separately from URL to allow custom naming + if [[ $repo_name == "null" ]]; then + repo_name="flathub" + fi + touch $repo_info # EOF breaks if the contents are indented, # so the below lines are intentionally un-indented