Files
2026-04-11 05:29:20 -07:00

29 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Install the default flatpak repos and pre-install apps in chroot
on_chroot <<- EOF
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
EOF
# Copy app list
# Format: "repo: app.id1 app.id2 ..." — lines starting with "#" are comments
mkdir -p "${ROOTFS_DIR}/etc/flatpak"
install -m 644 files/flatpack-apps.txt "${ROOTFS_DIR}/etc/flatpak/apps.txt"
# Pre-install flatpaks in chroot (post-install apply_extra scripts may fail without bwrap,
# but apps are fully usable — a first-boot service runs flatpak update to complete them)
on_chroot <<- EOF
while IFS=: read -r repo apps; do
[[ "\$repo" =~ ^[[:space:]]*# ]] && continue
[ -z "\${repo// /}" ] && continue
flatpak install -y --noninteractive "\${repo// /}" \$apps
done < /etc/flatpak/apps.txt
EOF
# First-boot service: runs flatpak update once network is available to complete
# any apply_extra steps (e.g. openh264) that couldn't run in the chroot
install -m 644 files/flatpak-firstboot.service "${ROOTFS_DIR}/etc/systemd/system/flatpak-firstboot.service"
on_chroot <<- EOF
systemctl enable flatpak-firstboot.service
EOF