Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

feat: split flatpak update units into user and system #72

Merged
merged 2 commits into from
Feb 23, 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
3 changes: 2 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ FROM quay.io/fedora-ostree-desktops/silverblue:${FEDORA_MAJOR_VERSION}
RUN wget https://copr.fedorainfracloud.org/coprs/ublue-os/vanilla-first-setup/repo/fedora-$(rpm -E %fedora)/ublue-os-vanilla-first-setup-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_ublue-os-vanilla-first-setup.repo

COPY etc /etc
COPY usr /usr

COPY ublue-firstboot /usr/bin

RUN rpm-ostree override remove firefox firefox-langpacks && \
rpm-ostree install distrobox gnome-tweaks just vte291-gtk4-devel vanilla-first-setup && \
sed -i 's/#AutomaticUpdatePolicy.*/AutomaticUpdatePolicy=stage/' /etc/rpm-ostreed.conf && \
systemctl enable rpm-ostreed-automatic.timer && \
systemctl enable flatpak-automatic.timer && \
systemctl enable flatpak-system-update.timer && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-vanilla-first-setup.repo && \
rm -rf \
/tmp/* \
Expand Down
12 changes: 11 additions & 1 deletion ublue-firstboot
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,18 @@ if [ "$?" != 0 ] ; then
--text="Installing Celluloid Failed"
exit 1
fi
echo "95"

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
Expand All @@ -139,4 +149,4 @@ cp -n /etc/justfile "$HOME"/.justfile
if [ "$?" != 0 ] ; then
zenity --error \
--text="Firstboot Configuration Error"
fi
fi
12 changes: 12 additions & 0 deletions usr/lib/systemd/system/flatpak-system-update.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Flatpak Automatic Update
Documentation=man:flatpak(1)
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --system update -y --noninteractive

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=flatpak Automatic Update Trigger
Description=Flatpak Automatic Update Trigger
Documentation=man:flatpak(1)

[Timer]
Expand All @@ -8,4 +8,4 @@ OnCalendar=0/6:00:00
Persistent=true

[Install]
WantedBy=timers.target
WantedBy=timers.target
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[Unit]
Description=flatpak Automatic Update
Description=Flatpak Automatic Update
Documentation=man:flatpak(1)
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak update -y
ExecStart=/usr/bin/flatpak --user update -y --noninteractive

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions usr/lib/systemd/user/flatpak-user-update.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Flatpak Automatic Update Trigger
Documentation=man:flatpak(1)

[Timer]
OnBootSec=5m
OnCalendar=0/6:00:00
Persistent=true

[Install]
WantedBy=timers.target