Skip to content

Commit

Permalink
Attempt to re-enable ublue-update
Browse files Browse the repository at this point in the history
  • Loading branch information
detiber committed Dec 8, 2024
1 parent d40436c commit 2723ca8
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 1 deletion.
8 changes: 8 additions & 0 deletions files/system/common/etc/ublue-update/ublue-update.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# copied from https://github.com/ublue-os/bluefin
[checks]
min_battery_percent = 20.0
max_cpu_load_percent = 50.0
max_mem_percent = 90.0
network_not_metered = true # Abort if network connection is metered
[notify]
dbus_notify = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# copied from https://github.com/ublue-os/bluefin
[Desktop Entry]
Type=Application
Name=System Update
Comment=Update Bluefin, Flatpaks, Distrobox containers, and more
Icon=ublue-update
Categories=ConsoleOnly;System;
Terminal=true
Exec=/usr/bin/ujust update
45 changes: 45 additions & 0 deletions files/system/common/usr/share/ublue-os/just/10-update.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# vim: set ft=make :
# copied from https://github.com/ublue-os/bluefin

alias upgrade := update

# Update system, flatpaks, and containers all at once
update:
#!/usr/bin/bash
TOPGRADE_CONFIG="/usr/share/ublue-os/topgrade"
/usr/bin/grep "^LockLayering=true" /etc/rpm-ostreed.conf &>/dev/null && TOPGRADE_CONFIG="${TOPGRADE_CONFIG}-bootc"
/usr/bin/topgrade --config "${TOPGRADE_CONFIG}.toml" --keep

alias auto-update := toggle-updates

# Turn automatic updates on or off
toggle-updates ACTION="prompt":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
CURRENT_STATE="Disabled"
if systemctl is-enabled ublue-update.timer | grep -q enabled; then
CURRENT_STATE="Enabled"
fi
OPTION={{ ACTION }}
if [ "$OPTION" == "prompt" ]; then
echo "Automatic updates are currently: ${bold}${CURRENT_STATE}${normal}"
echo "Enable or Disable automatic updates?"
OPTION=$(ugum choose Enable Disable)
elif [ "$OPTION" == "help" ]; then
echo "Usage: ujust toggle-updates <option>"
echo " <option>: Specify the quick option - 'enable' or 'disable'"
echo " Use 'enable' to Enable automatic updates."
echo " Use 'disable' to Disable automatic updates."
exit 0
fi
if [ "${OPTION,,}" == "enable" ]; then
sudo systemctl enable ublue-update.timer
elif [ "${OPTION,,}" == "disable" ]; then
sudo systemctl disable ublue-update.timer
fi

alias changelog := changelogs

# Show the changelog
changelogs:
rpm-ostree db diff --changelogs
11 changes: 11 additions & 0 deletions files/system/common/usr/share/ublue-os/topgrade-bootc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# copied from https://github.com/ublue-os/bluefin
[misc]
no_self_update = true
only = ["custom_commands", "flatpak", "distrobox", "firmware"]
disable = ["self_update", "toolbx", "containers", "helm", "system"]
ignore_failures = ["distrobox", "flatpak", "brew_cask", "brew_formula", "nix", "node", "pip3", "home_manager", "firmware"]
assume_yes = true
no_retry = false

[commands]
"System Upgrade" = "sudo bootc upgrade"
11 changes: 11 additions & 0 deletions files/system/common/usr/share/ublue-os/topgrade.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# copied from https://github.com/ublue-os/bluefin
[misc]
no_self_update = true
only = ["system", "flatpak", "distrobox", "firmware"]
disable = ["self_update", "toolbx", "containers", "helm"]
ignore_failures = ["distrobox", "flatpak", "brew_cask", "brew_formula", "nix", "node", "pip3", "home_manager", "firmware"]
assume_yes = true
no_retry = false

[linux]
rpm_ostree = true
3 changes: 2 additions & 1 deletion recipes/beardy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ modules:
- type: bling
install:
- rpmfusion
# - ublue-update
- ublue-update
- 1password
- dconf-update-service

Expand Down Expand Up @@ -128,5 +128,6 @@ modules:
enabled:
- podman.socket
- sshd.service
- ublue-update.service

- type: signing # this sets up the proper policy & signing files for signed images to work fully

0 comments on commit 2723ca8

Please sign in to comment.