Merge pull request #13 from ublue-os/yafti

feat: use yafti
This commit is contained in:
Eino Rauhala
2023-04-02 15:52:35 +03:00
committed by GitHub
6 changed files with 132 additions and 12 deletions

View File

@@ -7,8 +7,7 @@ FROM ghcr.io/ublue-os/silverblue-main:${FEDORA_MAJOR_VERSION}
COPY etc /etc
# COPY usr /usr
COPY ublue-firstboot /usr/bin
COPY recipe.yml /etc/ublue-recipe.yml
COPY recipe.yml /tmp/ublue-recipe.yml
# yq used in build.sh and the setup-flatpaks recipe to read the recipe.yml
# copied from the official container image as it's not avaible as an rpm

View File

@@ -1,10 +1,22 @@
#!/bin/bash
# remove the default firefox (from fedora) in favor of the flatpak
rpm-ostree override remove firefox firefox-langpacks
echo "-- Installing RPMs defined in recipe.yml --"
rpm_packages=$(yq '.rpms[]' < /etc/ublue-recipe.yml)
for pkg in $rpm_packages; do \
rpm_packages=$(yq '.rpms[]' < /tmp/ublue-recipe.yml)
for pkg in $(echo -e "$rpm_packages"); do \
echo "Installing: ${pkg}" && \
rpm-ostree install $pkg; \
done
echo "---"
echo "---"
# install yafti to install flatpaks on first boot, https://github.com/ublue-os/yafti
pip install --prefix=/usr yafti
# add a package group for yafti using the packages defined in recipe.yml
yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' /etc/yafti.yml
yq -i '.screens.applications.values.groups.Custom.default = true' /etc/yafti.yml
flatpaks=$(yq '.flatpaks[]' < /tmp/ublue-recipe.yml)
for pkg in $(echo -e "$flatpaks"); do \
yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" /etc/yafti.yml
done

View File

@@ -1,6 +1,6 @@
if test "$(id -u)" -gt "0" && test -d "$HOME"; then
if test ! -e "$HOME"/.config/ublue/firstboot-done; then
if test ! -e "$HOME"/.config/autostart/ublue-firstboot.desktop; then
mkdir -p "$HOME"/.config/autostart
cp -f /etc/skel.d/.config/autostart/ublue-firstboot.desktop "$HOME"/.config/autostart
fi
fi
fi

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Ublue Desktop FirstBoot Setup
Comment=Sets up Ublue Desktop Correctly On FirstBoot
Exec=/usr/bin/ublue-firstboot
Name=uBlue First Boot Setup
Comment=Sets up uBlue Desktop Correctly On FirstBoot
Exec=/usr/bin/yafti /etc/yafti.yml
Icon=org.gnome.Terminal
Type=Application
Categories=Utility;System;
Name[en_US]=startup
Name[en_US]=startup

109
etc/yafti.yml Normal file
View File

@@ -0,0 +1,109 @@
title: Welcome to uBlue
properties:
mode: "run-on-change"
screens:
first-screen:
source: yafti.screen.title
values:
title: "Welcome to uBlue (Alpha)"
icon: "/path/to/icon"
description: |
Pick some applications to get started
can-we-modify-your-flatpaks:
source: yafti.screen.consent
values:
title: Welcome, Traveler
condition:
run: flatpak remotes --system | grep fedora
description: |
WARNING: This will modify your Flatpaks if you are rebasing! If you do not want to do this exit the installer.
actions:
- run: flatpak remote-delete fedora --force
- run: flatpak remove --system --noninteractive --all
- run: flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
applications:
source: yafti.screen.package
values:
title: Application Installation
show_terminal: true
package_manager: yafti.plugin.flatpak
groups:
Core:
description: Core Applications
default: true
packages:
- Backup: org.gnome.DejaDup
- Calculator: org.gnome.Calculator
- Calendar: org.gnome.Calendar
- Characters: org.gnome.Characters
- Connections: org.gnome.Connections
- Contacts: org.gnome.Contacts
- Document Viewer: org.gnome.Evince
- Extensions Manager: com.mattjakeman.ExtensionManager
- Fedora Media Writer: org.fedoraproject.MediaWriter
- Mozilla Firefox: org.mozilla.firefox
- Flatseal Permissions Manager: com.github.tchx84.Flatseal
- Logs: org.gnome.Logs
- Maps: org.gnome.Maps
- Nautilus Preview: org.gnome.NautilusPreviewer
- Text Editor: org.gnome.TextEditor
- Weather: org.gnome.Weather
- Disk Usage Analyzer: org.gnome.baobab
- Clocks: org.gnome.clocks
- Picture Viewer: org.gnome.eog
- Font Viewer: org.gnome.font-viewer
- Font Downloader: org.gustavoperedo.FontDownloader
Web Browsers:
description: Additional browsers to complement Firefox
default: false
packages:
- Brave: com.brave.Browser
- Google Chrome: com.google.Chrome
- Microsoft Edge: com.microsoft.Edge
- Opera: com.opera.Opera
Gaming:
description: "Rock and Stone!"
default: false
packages:
- Bottles: com.usebottles.bottles
- Discord: com.discordapp.Discord
- Games: org.gnome.Games
- Heroic Games Launcher: com.heroicgameslauncher.hgl
- MangoHUD: org.freedesktop.Platform.VulkanLayer.MangoHud//22.08
- Steam: com.valvesoftware.Steam
- Gamescope for Steam: com.valvesoftware.Steam.Utility.gamescope
- Proton Updater for Steam: net.davidotek.pupgui2
Office:
description: Bow to Capitalism
default: false
packages:
- LibreOffice: org.libreoffice.LibreOffice
- Obsidian: md.obsidian.Obsidian
- OnlyOffice: org.onlyoffice.desktopeditors
- Slack: com.slack.Slack
- Standard Notes: org.standardnotes.standardnotes
- Thunderbird Email: org.mozilla.Thunderbird
Streaming:
description: Stream to the Internet
default: false
packages:
- OBS Studio: com.obsproject.Studio
- VkCapture for OBS: com.obsproject.Studio.OBSVkCapture
- Gstreamer for OBS: com.obsproject.Studio.Plugin.Gstreamer
- Gstreamer VAAPI for OBS: com.obsproject.Studio.Plugin.GStreamerVaapi
- Boatswain for Streamdeck: com.feaneron.Boatswain
final-screen:
source: yafti.screen.title
values:
title: "All done!"
icon: "/path/to/icon"
links:
- "Install More Applications":
run: /usr/bin/gnome-software
- "Website":
run: /usr/bin/xdg-open https://ublue.it
- "Join the Discord Community":
run: /usr/bin/xdg-open https://discord.gg/XjG48C7VHx
description: |
Thanks for trying uBlue, we hope you enjoy it!

View File

@@ -1,5 +1,5 @@
rpms:
- zenity
- python3-pip # needed for yafti
flatpaks:
- org.mozilla.firefox
- org.mozilla.Thunderbird