From 4a4b1b90440b7c7a658bbec794a6efc75016809d Mon Sep 17 00:00:00 2001 From: Bastien Riviere Date: Mon, 3 Jun 2024 19:46:13 +0200 Subject: [PATCH] feat: add topgrade --- build.sh | 6 +++++- ...{azure-distrobox.service => azure-topgrade.service} | 4 ++-- files/usr/libexec/azure-distrobox | 10 ---------- files/usr/libexec/azure-topgrade | 5 +++++ files/usr/share/azure/topgrade.toml | 9 +++++++++ packages | 3 +++ 6 files changed, 24 insertions(+), 13 deletions(-) rename files/usr/lib/systemd/user/{azure-distrobox.service => azure-topgrade.service} (67%) delete mode 100755 files/usr/libexec/azure-distrobox create mode 100755 files/usr/libexec/azure-topgrade create mode 100644 files/usr/share/azure/topgrade.toml diff --git a/build.sh b/build.sh index 123fcf5..3ca6452 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,10 @@ grep -v '^#' /tmp/packages | xargs rpm-ostree install rpm-ostree override remove opensc + +# Install topgrade +pip install --prefix=/usr topgrade + # Installed via flatpak rpm-ostree override remove firefox firefox-langpacks @@ -34,7 +38,7 @@ systemctl enable incus.socket systemctl enable podman.socket systemctl enable tailscaled.service systemctl enable -f --global flatpak-setup.service -systemctl enable -f --global azure-distrobox.service +systemctl enable -f --global azure-topgrade.service systemctl enable azure-system-setup.service systemctl enable azure-groups.service diff --git a/files/usr/lib/systemd/user/azure-distrobox.service b/files/usr/lib/systemd/user/azure-topgrade.service similarity index 67% rename from files/usr/lib/systemd/user/azure-distrobox.service rename to files/usr/lib/systemd/user/azure-topgrade.service index d8e7a80..ac2dc78 100644 --- a/files/usr/lib/systemd/user/azure-distrobox.service +++ b/files/usr/lib/systemd/user/azure-topgrade.service @@ -1,11 +1,11 @@ [Unit] -Description=Update distrobox for current user +Description=Update everything for current user Wants=network-online.target After=network-online.service [Service] Type=simple -ExecStart=/usr/libexec/azure-distrobox +ExecStart=/usr/libexec/azure-topgrade Restart=on-failure RestartSec=30 StartLimitInterval=0 diff --git a/files/usr/libexec/azure-distrobox b/files/usr/libexec/azure-distrobox deleted file mode 100755 index 752ab26..0000000 --- a/files/usr/libexec/azure-distrobox +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -if [ ! -f ~/.config/distrobox.ini ]; then - echo "No distrobox config at ~/.config/distrobox.ini, skipping" - exit 0 -fi - -notify-send "Azure Distrobox" "Updating distroboxes" -u NORMAL -distrobox assemble create --file ~/.config/distrobox.ini -notify-send "Azure Distrobox" "Finished updating distroboxes" -u NORMAL diff --git a/files/usr/libexec/azure-topgrade b/files/usr/libexec/azure-topgrade new file mode 100755 index 0000000..feeca08 --- /dev/null +++ b/files/usr/libexec/azure-topgrade @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +notify-send "Azure" "Running topgrade" -u NORMAL +topgrade --config /usr/share/azure/topgrade.toml +notify-send "Azure" "topgrade finished" -u NORMAL diff --git a/files/usr/share/azure/topgrade.toml b/files/usr/share/azure/topgrade.toml new file mode 100644 index 0000000..bdda2b8 --- /dev/null +++ b/files/usr/share/azure/topgrade.toml @@ -0,0 +1,9 @@ +[misc] +no_self_update = true +disable = ["self_update", "toolbx", "containers", "helm", "nix"] +ignore_failures = ["distrobox", "flatpak", "brew_cask", "brew_formula", "node", "pip3", "home_manager", "firmware"] +assume_yes = true +no_retry = false + +[linux] +rpm_ostree = true diff --git a/packages b/packages index a2f345b..9f86486 100644 --- a/packages +++ b/packages @@ -83,6 +83,9 @@ fish zsh zoxide +# python / for topgrade +python3-pip + # classic dev tools gcc make