Skip to content

Commit

Permalink
fix: Remove flatpak caching, use network connection instead (#110)
Browse files Browse the repository at this point in the history
* fix: Stop caching flatpaks

These take up way too much space in images

* fix(flatpak-system-install): Require network connection

* fix(flatpak-system-install): Restart on failure

* fix(gnome): Add Silverblue flatpaks to install list

* fix(flatpak-system-install): Silence errors on package removal

A package may not be removed for a number of reasons, for example if someone were
to rebase from Kinoite to Bazzite GNOME, they wouldn't have the GNOME app suite
installed from Silverblue

* fix(deck): Don't try to install cached system flatpaks
  • Loading branch information
EyeCantCU authored Aug 6, 2023
1 parent 11d4c66 commit 56938e2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
5 changes: 0 additions & 5 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ RUN rm /usr/share/applications/shredder.desktop && \
sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/system.conf && \
mkdir -p /etc/flatpak/remotes.d && \
wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /etc/flatpak/remotes.d && \
cat /etc/flatpak/install | while read line; do flatpak install --system --noninteractive --no-deploy flathub $line; done && \
cat /etc/flatpak/deck | while read line; do flatpak install --system --noninteractive --no-deploy flathub $line; done && \
mkdir -p /etc/flatpak/{flathub,objects} && \
cp -r /var/lib/flatpak/repo/refs/remotes/flathub/* /etc/flatpak/flathub && \
cp -r /var/lib/flatpak/repo/objects/* /etc/flatpak/objects && \
systemctl unmask flatpak-system-install.service && \
systemctl enable flatpak-system-install.service && \
systemctl disable rpm-ostreed-automatic.timer && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[Unit]
Description=Install System Flatpak on boot
Documentation=https://github.com/ublue-os/endlish-oesque/issues/10
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ublue-flatpak-system-install
Restart=on-failure

[Install]
WantedBy=multi-user.target
11 changes: 5 additions & 6 deletions system_files/desktop/shared/usr/bin/ublue-flatpak-system-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
source /etc/default/bazzite

if [[ -f '/etc/flatpak/install' ]]; then
cp -r /etc/flatpak/flathub/* /var/lib/flatpak/repo/refs/remotes/flathub
cp -r /etc/flatpak/objects/* /var/lib/flatpak/repo/objects
cat /etc/flatpak/install | while read line; do
flatpak install --system --noninteractive --no-pull flathub $line
flatpak install --system --noninteractive flathub $line
done && mv /etc/flatpak/install /etc/flatpak/installed
fi

if [[ -f '/etc/flatpak/remove' ]]; then
cat /etc/flatpak/remove | while read line; do
flatpak remove --system --noninteractive $line
done && mv /etc/flatpak/install /etc/flatpak/removed
flatpak remove --system --noninteractive $line 2>/dev/null
done
mv /etc/flatpak/remove /etc/flatpak/removed
fi

if [[ -f '/etc/flatpak/deck' ]]; then
if [[ ${IMAGE_NAME} == *'deck'* ]]; then
cat /etc/flatpak/deck | while read line; do
flatpak install --system --noninteractive --no-pull flathub $line
flatpak install --system --noninteractive flathub $line
done && cat /etc/flatpak/deck >> /etc/flatpak/installed
fi
fi
Expand Down
17 changes: 16 additions & 1 deletion system_files/desktop/silverblue/etc/flatpak/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@ net.davidotek.pupgui2
org.freedesktop.Platform.VulkanLayer.MangoHud//22.08
org.freedesktop.Platform.VulkanLayer.vkBasalt//22.08
io.github.Foldex.AdwSteamGtk
org.gnome.Loupe
com.mattjakeman.ExtensionManager
org.gtk.Gtk3theme.adw-gtk3
org.gtk.Gtk3theme.adw-gtk3-dark
org.mozilla.firefox
com.github.tchx84.Flatseal
org.gnome.Calculator
org.gnome.Calendar
org.gnome.Characters
org.gnome.Connections
org.gnome.Contacts
org.gnome.Evince
org.gnome.Extensions
org.gnome.Logs
org.gnome.Loupe
org.gnome.Maps
org.gnome.NautilusPreviewer
org.gnome.TextEditor
org.gnome.Weather
org.gnome.baobab
org.gnome.clocks
org.gnome.font-viewer

0 comments on commit 56938e2

Please sign in to comment.