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:
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Nomarchy Full Update Script
|
||||
# 1. Syncs the local repository (if applicable)
|
||||
# 2. Performs a full system update (NixOS + Home Manager)
|
||||
# 1. Removes the installation pin (if present) to follow the rolling release.
|
||||
# 2. Updates flake inputs (Nomarchy, nixpkgs, etc.) in flake.lock.
|
||||
# 3. Performs a full system update (NixOS + Home Manager)
|
||||
|
||||
set -e
|
||||
|
||||
@@ -18,15 +19,17 @@ fi
|
||||
|
||||
echo "--- Starting Nomarchy Full Update ---"
|
||||
|
||||
# 1. Sync repository if it's a git repo
|
||||
if [ -d "$REPO_DIR/.git" ]; then
|
||||
echo "Syncing repository from remote..."
|
||||
if ! git -C "$REPO_DIR" pull --ff-only; then
|
||||
echo "Warning: git pull failed. Proceeding with local configuration."
|
||||
fi
|
||||
# 1. Unpin the flake if it's currently pinned to the install commit
|
||||
if grep -q "rev=" "$REPO_DIR/flake.nix"; then
|
||||
echo "Removing installation pin to follow rolling release..."
|
||||
sudo sed -i 's/?rev=[a-f0-9]*//g' "$REPO_DIR/flake.nix"
|
||||
fi
|
||||
|
||||
# 2. System update
|
||||
# 2. Update flake inputs
|
||||
echo "Updating flake inputs (this may take a moment)..."
|
||||
sudo nix --extra-experimental-features 'nix-command flakes' flake update --flake "$REPO_DIR"
|
||||
|
||||
# 3. System update
|
||||
nomarchy-sys-update
|
||||
|
||||
echo "--- Nomarchy Full Update Complete ---"
|
||||
|
||||
@@ -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