feat: startingpoint modules (#33)

* feat: add startingpoint modules
some modules authored by @gerblesh
original source: https://github.com/ublue-os/startingpoint/pull/135

* docs: better readme for modules dir

* docs: yafti deps

* docs: sp more information

* feat: startingpoint modules in container

* docs: sentence structure, check sidebar
This commit is contained in:
xyny 2023-09-10 14:29:26 +00:00 committed by GitHub
parent 288945331e
commit 7c4dd1553e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 408 additions and 0 deletions

16
modules/yafti/README.md Normal file
View file

@ -0,0 +1,16 @@
# [`yafti`](https://github.com/ublue-os/yafti) Module for Startingpoint
If included, the `yafti` module will install `yafti` and set it up to run on first boot. Also `yafti`'s dependencies, `python3-pip` and `libadwaita` are installed
Optionally, a list of Flatpak names and IDs can be included under `custom-flatpaks:`. These will be enabled by default under their own section on the Flatpak installation screen of `yafti`.
The main `yafti` configuration file, `yafti.yml`, is in `/usr/share/ublue-os/firstboot/yafti.yml` and can be edited for a more custom first-boot experience.
## Example configuration:
```yml
type: yafti
custom-flatpaks:
- Celluloid: io.github.celluloid_player.Celluloid
- Krita: org.kde.krita
```

31
modules/yafti/yafti.sh Normal file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
FIRSTBOOT_DATA="/usr/share/ublue-os/firstboot"
FIRSTBOOT_LINK="/usr/etc/profile.d/ublue-firstboot.sh"
echo "Installing python3-pip and libadwaita"
rpm-ostree install python3-pip libadwaita
echo "Installing and enabling yafti"
pip install --prefix=/usr yafti
# Create symlink to our profile script, which creates the per-user "autorun yafti" links.
mkdir -p "$(dirname "${FIRSTBOOT_LINK}")"
ln -s "${FIRSTBOOT_DATA}/launcher/login-profile.sh" "${FIRSTBOOT_LINK}"
YAFTI_FILE="$FIRSTBOOT_DATA/yafti.yml"
get_yaml_array FLATPAKS '.custom-flatpaks[]' "$1"
if [[ ${#FLATPAKS[@]} -gt 0 ]]; then
echo "Adding Flatpaks to yafti.yml"
yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks suggested by the image maintainer."' "${YAFTI_FILE}"
yq -i '.screens.applications.values.groups.Custom.default = true' "${YAFTI_FILE}"
for pkg in "${FLATPAKS[@]}"; do
echo "Adding to yafti: ${pkg}"
yq -i ".screens.applications.values.groups.Custom.packages += [$pkg]" "${YAFTI_FILE}"
done
fi