This commit is contained in:
m3tm3re
2026-01-18 10:55:37 +01:00
parent b76a8a68b2
commit 14605b313d

View File

@@ -69,26 +69,49 @@ jobs:
UPDATES_FOUND=false
UPDATED_PACKAGES=""
SKIP_PACKAGES=(
"hyprpaper-random"
"launch-webapp"
"stt-ptt"
"tuxedo-backlight"
"zellij-ps"
"msty-studio"
"rofi-project-opener"
"pomodoro-timer"
)
check_commit() {
[ "$1" != "$(git rev-parse HEAD)" ] && echo "true" || echo "false"
}
has_update_script() {
should_skip() {
local pkg=$1
nix eval ".#$pkg.passthru.updateScript" >/dev/null 2>&1
for skip in "${SKIP_PACKAGES[@]}"; do
[ "$pkg" = "$skip" ] && return 0
done
return 1
}
run_update() {
local pkg=$1
local before_hash=$(git rev-parse HEAD)
if ! has_update_script "$pkg"; then
echo "⏭️ Skipping $pkg (no updateScript defined)"
if should_skip "$pkg"; then
echo "⏭️ Skipping $pkg (in skip list)"
return 1
fi
echo "::group::Updating $pkg"
if nix-update --flake --commit --use-update-script "$pkg" 2>&1 | tee /tmp/update-${pkg}.log; then
local args=("--flake" "--commit")
if [ "$pkg" = "opencode" ]; then
args+=("--subpackage" "node_modules")
fi
args+=("$pkg")
if nix-update "${args[@]}" 2>&1 | tee /tmp/update-${pkg}.log; then
if [ "$(check_commit "$before_hash")" = "true" ]; then
echo "✅ Updated $pkg"
echo "::endgroup::"