fix(scripts): improve offline resilience and restore missing update scripts
All checks were successful
Check / eval-and-lint (push) Successful in 7m5s

This commit is contained in:
Bernardo Magri
2026-06-01 20:07:08 +01:00
parent 6ed2ca3d78
commit 1e6becd42d
6 changed files with 67 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Nomarchy Full Update Script
# 1. Syncs the local repository (if applicable)
# 2. Performs a full system update (NixOS + Home Manager)
set -e
# Detect the repository location
if [ -f "/etc/nixos/flake.nix" ]; then
REPO_DIR="/etc/nixos"
elif [ -f "/etc/nomarchy/flake.nix" ]; then
REPO_DIR="/etc/nomarchy"
else
echo "Error: Nomarchy flake repository not found in /etc/nixos or /etc/nomarchy."
exit 1
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
fi
# 2. System update
nomarchy-sys-update
echo "--- Nomarchy Full Update Complete ---"