fix(scripts): improve offline resilience and restore missing update scripts
All checks were successful
Check / eval-and-lint (push) Successful in 7m5s
All checks were successful
Check / eval-and-lint (push) Successful in 7m5s
This commit is contained in:
32
features/scripts/utils/nomarchy-update
Executable file
32
features/scripts/utils/nomarchy-update
Executable 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 ---"
|
||||
Reference in New Issue
Block a user