docs: finalize roadmap entries for flake updates and offline resilience
All checks were successful
Check / eval-and-lint (push) Successful in 6m43s
All checks were successful
Check / eval-and-lint (push) Successful in 6m43s
This commit is contained in:
@@ -21,9 +21,37 @@ if ! ping -c 1 -W 2 1.1.1.1 >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get current status
|
||||
CURRENT_REV=$(nix flake metadata "$REPO_DIR" --json | jq -r '.lock.nodes.root.inputs.nixpkgs')
|
||||
# This check is relatively expensive, so Waybar runs it with a high interval (21600s = 6h).
|
||||
# Get the current locked revision for Nomarchy
|
||||
LOCKED_REV=$(jq -r '.nodes.nomarchy.locked.rev // empty' "$REPO_DIR/flake.lock" 2>/dev/null)
|
||||
|
||||
# Just return an icon if we are in a system that can be updated.
|
||||
echo ""
|
||||
if [ -z "$LOCKED_REV" ]; then
|
||||
# Could be named something else or missing, fallback to generic icon
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if we are pinned in flake.nix
|
||||
if grep -q "rev=" "$REPO_DIR/flake.nix" 2>/dev/null; then
|
||||
# We are pinned. An update implies unpinning and upgrading.
|
||||
# We can just show the icon to encourage the user to update and unpin.
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get remote latest revision
|
||||
REMOTE_URL="https://git.bemagri.xyz/bernardo/Nomarchy.git"
|
||||
# Fast-fail check with git ls-remote (usually takes < 1s if online)
|
||||
LATEST_REV=$(git ls-remote "$REMOTE_URL" HEAD 2>/dev/null | awk '{print $1}')
|
||||
|
||||
if [ -z "$LATEST_REV" ]; then
|
||||
# Couldn't reach remote
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Compare revisions
|
||||
if [ "$LOCKED_REV" != "$LATEST_REV" ]; then
|
||||
echo ""
|
||||
else
|
||||
# No updates available
|
||||
echo ""
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user