Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

feat: switch to new ublue-os/main image #59

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ARG FEDORA_MAJOR_VERSION=37

FROM ghcr.io/ublue-os/base:${FEDORA_MAJOR_VERSION}
# See https://pagure.io/releng/issue/11047 for final location
FROM ghcr.io/ublue-os/silverblue-main:${FEDORA_MAJOR_VERSION}

COPY etc /etc
COPY usr /usr

COPY --from=ghcr.io/ublue-os/udev-rules:latest /ublue-os-udev-rules /
COPY --from=ghcr.io/ublue-os/config:latest /files/ublue-os-udev-rules /
COPY --from=ghcr.io/ublue-os/config:latest /files/ublue-os-update-services /

RUN wget https://github.com/terrapkg/subatomic-repos/raw/main/terra.repo -O /etc/yum.repos.d/terra.repo
RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-$(rpm -E %fedora)/kylegospo-gnome-vrr-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo
RUN wget https://copr.fedorainfracloud.org/coprs/sunwire/input-remapper/repo/fedora-37/sunwire-input-remapper-fedora-37.repo -O /etc/yum.repos.d/sunwire-input-remapper-fedora-37.repo
RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/webapp-manager/repo/fedora-37/kylegospo-webapp-manager-fedora-37.repo -O /etc/yum.repos.d/kylegospo-webapp-manager-fedora-37.repo
RUN rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr mutter gnome-control-center gnome-control-center-filesystem
RUN rpm-ostree override remove gnome-software-rpm-ostree
RUN rpm-ostree override remove gnome-software-rpm-ostree firefox firefox-langpacks
RUN rpm-ostree install blackbox-terminal gnome-shell-extension-appindicator gnome-shell-extension-dash-to-dock \
gnome-shell-extension-blur-my-shell gnome-shell-extension-gsconnect nautilus-gsconnect \
just libgda libgda-sqlite libratbag-ratbagd openssl podman-docker python3-input-remapper \
libgda libgda-sqlite libratbag-ratbagd openssl podman-docker python3-input-remapper \
tailscale virt-manager wireguard-tools webapp-manager yaru-theme && \
rm -f /var/lib/unbound/root.key && \
rm -f /var/lib/freeipmi/ipckey && \
Expand All @@ -41,4 +41,4 @@ COPY --from=cgr.dev/chainguard/cosign:latest /usr/bin/cosign /usr/bin/cosign

RUN curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.17.0/kind-$(uname)-amd64"
RUN chmod +x ./kind
RUN mv ./kind /usr/bin/kind
RUN mv ./kind /usr/bin/kind
8 changes: 8 additions & 0 deletions etc/.config/autostart/ublue-firstboot.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=Ublue Desktop FirstBoot Setup
Comment=Sets up Ublue Desktop Correctly On FirstBoot
Exec=/usr/bin/ublue-firstboot
Icon=org.gnome.Terminal
Type=Application
Categories=Utility;System;
Name[en_US]=startup
64 changes: 64 additions & 0 deletions etc/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
default:
@just --list

bios:
systemctl reboot --firmware-setup

changelogs:
rpm-ostree db diff --changelogs

distrobox-boxkit:
echo 'Creating Boxkit distrobox ...'
distrobox create --image ghcr.io/ublue-os/boxkit -n boxkit -Y

distrobox-debian:
echo 'Creating Debian distrobox ...'
distrobox create --image quay.io/toolbx-images/debian-toolbox:unstable -n debian -Y

distrobox-opensuse:
echo 'Creating openSUSE distrobox ...'
distrobox create --image quay.io/toolbx-images/opensuse-toolbox:tumbleweed -n opensuse -Y

distrobox-ubuntu:
echo 'Creating Ubuntu distrobox ...'
distrobox create --image quay.io/toolbx-images/ubuntu-toolbox:22.04 -n ubuntu -Y

setup-flatpaks:
echo 'Installing flatpaks from the ublue recipe ...'
flatpaks=$(dasel -f /etc/ublue-recipe.yml -r yaml -w json -s 'flatpaks')
flatpaks_count=$(echo $flatpaks | dasel -r json -s 'len()')
for i in $(seq 0 $(($flatpaks_count-1))); do
pkg=$(echo $flatpaks | dasel -r json "[${i}]" | tr -d '"')
echo "# Installing ${pkg}"
flatpak install --user --noninteractive flathub $pkg
done

setup-pwa:
echo 'Giving browser permission to create PWAs (Progressive Web Apps)'
# Add for your favorite chromium-based browser
flatpak override --user --filesystem=~/.local/share/applications --filesystem=~/.local/share/icons com.microsoft.Edge

setup-gaming:
echo 'Setting up gaming experience ... lock and load.'
flatpak install -y --user \\
com.discordapp.Discord \\
com.feaneron.Boatswain \\
org.freedesktop.Platform.VulkanLayer.MangoHud//22.08 \\
org.freedesktop.Platform.VulkanLayer.OBSVkCapture//22.08 \\
org.freedesktop.Platform.VulkanLayer.vkBasalt//22.08 \\
com.heroicgameslauncher.hgl \\
com.obsproject.Studio \\
com.obsproject.Studio.Plugin.OBSVkCapture \\
com.obsproject.Studio.Plugin.Gstreamer \\
com.usebottles.bottles \\
com.valvesoftware.Steam \\
com.valvesoftware.Steam.Utility.gamescope \\
net.davidotek.pupgui2
flatpak override com.usebottles.bottles --user --filesystem=xdg-data/applications
flatpak override --user --env=MANGOHUD=1 com.valvesoftware.Steam
flatpak override --user --env=MANGOHUD=1 com.heroicgameslauncher.hgl

update:
rpm-ostree update
flatpak update -y
distrobox upgrade -a
6 changes: 6 additions & 0 deletions etc/profile.d/ublue-firstboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if test "$(id -u)" -gt "0" && test -d "$HOME"; then
if test ! -e "$HOME"/.config/ublue/firstboot-done; then
mkdir -p "$HOME"/.config/autostart
cp -f /etc/skel.d/.config/autostart/ublue-firstboot.desktop "$HOME"/.config/autostart
fi
fi
10 changes: 10 additions & 0 deletions recipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rpms:
flatpaks:
- org.mozilla.firefox
- org.mozilla.Thunderbird
- com.mattjakeman.ExtensionManager
- org.libreoffice.LibreOffice
- org.gnome.DejaDup
- org.gustavoperedo.FontDownloader
- com.github.tchx84.Flatseal
- io.github.celluloid_player.Celluloid
99 changes: 99 additions & 0 deletions ublue-firstboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/bin/sh

if test -e "$HOME"/.config/ublue/firstboot-done; then
echo "Already ran"
exit 0
fi

(
echo "# Waiting for Internet connection"
until /usr/bin/ping -q -c 1 flathub.org; do sleep 1; done
echo "00"

echo "# Removing Filtered Flathub Repository"
/usr/bin/flatpak remote-delete flathub --force ||:
if [ "$?" != 0 ] ; then
zenity --error \
--text="Removing Filtered Flathub Repo Failed"
exit 1
fi
echo "3"

echo "# Enabling Flathub Repository"
/usr/bin/flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
if [ "$?" != 0 ] ; then
zenity --error \
--text="Adding Flathub Repo Failed"
exit 1
fi
echo "5"

echo "# Replacing Fedora Flatpaks with Flathub Ones (this may take a while)"
/usr/bin/flatpak install --user --noninteractive org.gnome.Platform//43
/usr/bin/flatpak install --user --noninteractive --reinstall flathub $(flatpak list --app-runtime=org.fedoraproject.Platform --columns=application | tail -n +1 )
if [ "$?" != 0 ] ; then
zenity --error \
--text="Replacing Fedora Flatpaks Failed"
exit 1
fi
echo "20"

echo "Removing all preinstalled Flatpaks"
/usr/bin/flatpak remove --system --noninteractive --all ||:
if [ "$?" != 0 ] ; then
zenity --error \
--text="Removing all preinstalled flatpaks failed"
exit 1
fi

echo "# Removing Fedora Flatpak Repository"
/usr/bin/flatpak remote-delete fedora --force ||:
if [ "$?" != 0 ] ; then
zenity --error \
--text="Removing Fedora Flatpak Repo Failed"
exit 1
fi
echo "25"

echo "# Installing flatpaks from recipe"
flatpaks=$(yq '.flatpaks[]' < /etc/ublue-recipe.yml)
flatpaks_count=$(yq '.flatpaks[]' < /etc/ublue-recipe.yml | wc -l)
i=0
for pkg in $flatpaks; do
echo "# Installing ${pkg}"
/usr/bin/flatpak install --user --noninteractive flathub $pkg
if [ "$?" != 0 ] ; then
zenity --error \
--text="Installing ${pkg} Failed"
exit 1
fi
i=$((i+1))
# Automatically calculates evenly spaced progess using bc, cuts everything after decimal point.
echo "${i}/${flatpaks_count} * (95-30) + 30" | bc -l | cut -d "." -f1
done



echo "Enabling Flatpak auto update"
/usr/bin/systemctl --user enable --now flatpak-user-update.timer
if [ "$?" != 0 ] ; then
zenity --error \
--text="Setting Flatpak Autoupdate Failed"
exit 1
fi
echo "100"


echo "# Reticulating Final Splines"
mkdir -p "$HOME"/.config/ublue/
touch "$HOME"/.config/ublue/firstboot-done
cp -n /etc/justfile "$HOME"/.justfile

) |

zenity --progress --title="uBlue Desktop Firstboot" --percentage=0 --auto-close --no-cancel --width=300

if [ "$?" != 0 ] ; then
zenity --error \
--text="Firstboot Configuration Error"
fi