diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 4e3f9ea..cc7e95d 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -19,7 +19,10 @@ Guardrails (apply when adding anything): ### Now (ready to pick up) -_(empty — all entries shipped or moved to Later)_ +- **Ironclad: Offline Resilience.** Boot the VM with `-net none` and audit all scripts for network-induced hangs. Any script using `curl`, `wget`, `nix`, or `git` must implement a fast-fail "offline" check or a tight connect-timeout to ensure the UI remains responsive. +- **Ironclad: Multi-Monitor Integrity.** Verify Hyprland, Waybar, and Walker behavior on dual-screen setups. Ensure launchers follow the cursor and the bar handles secondary monitors gracefully. +- **Ironclad: Input Method (Fcitx5) Functional Pass.** Prove that non-ASCII input (Pinyin/Mozc) is functional in the live VM. Fix any Wayland-specific D-Bus or environment issues. +- **Ironclad: Overlap & Conflict Proofing.** Verify that manual Nix overrides in `home.nix` correctly and consistently take precedence over the machine-managed `nomarchy-state.nix`. ### Next (bigger lifts that build on Now) diff --git a/docs/SCRIPTS.md b/docs/SCRIPTS.md index 3de0ca4..cf25afd 100644 --- a/docs/SCRIPTS.md +++ b/docs/SCRIPTS.md @@ -133,7 +133,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-swayosd-kbd-brightness` | `core/system/scripts` | core/system/scripts/nomarchy-brightness-keyboard | `kept` | | | `nomarchy-sync` | `features/scripts/utils` | README.md,features/scripts/utils/nomarchy-backup, +1 more | `kept` | | | `nomarchy-sync-nix-state` | `features/scripts/utils` | features/scripts/utils/nomarchy-state-write | `kept` | | -| `nomarchy-sys-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-setup-dns, +5 more | `kept` | | +| `nomarchy-sys-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-setup-dns, +6 more | `kept` | | | `nomarchy-system-logout` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-system-reboot` | `core/system/scripts` | core/home/config/nomarchy-skill/SKILL.md,core/system/scripts/nomarchy-hibernation-setup, +2 more | `kept` | | | `nomarchy-system-shutdown` | `core/system/scripts` | core/home/config/nomarchy-skill/SKILL.md,core/home/config/nomarchy/extensions/menu.sh, +1 more | `kept` | | diff --git a/features/scripts/utils/nomarchy-update b/features/scripts/utils/nomarchy-update new file mode 100755 index 0000000..4bcd9b9 --- /dev/null +++ b/features/scripts/utils/nomarchy-update @@ -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 ---" diff --git a/features/scripts/utils/nomarchy-update-available b/features/scripts/utils/nomarchy-update-available index 6852b93..671d2bf 100644 --- a/features/scripts/utils/nomarchy-update-available +++ b/features/scripts/utils/nomarchy-update-available @@ -16,18 +16,14 @@ if [ -z "$REPO_DIR" ]; then exit 0 fi -# We use a simple logic: Check for flake updates periodically. -# Since this is run by Waybar, we should be careful with performance. - -# For a quick check, we can see if there are newer versions available for nixpkgs -# by checking nix flake metadata on the repo. +# Fast-fail if offline to avoid expensive nix commands. +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). # Just return an icon if we are in a system that can be updated. -# In a real implementation, we could compare local flake.lock vs upstream if it's a git repo. -# For now, we'll return the update icon to show it's active. - echo "" diff --git a/features/scripts/utils/nomarchy-update-time b/features/scripts/utils/nomarchy-update-time new file mode 100755 index 0000000..08c92fd --- /dev/null +++ b/features/scripts/utils/nomarchy-update-time @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Nomarchy Time Sync Script +# Force sync system time using systemd-timesyncd + +set -e + +echo "Syncing system time..." +if ! sudo systemctl restart systemd-timesyncd; then + echo "Error: Failed to restart systemd-timesyncd. Check internet connection." + exit 1 +fi + +# Wait a moment for sync +sleep 2 + +echo "Current time: $(date)" +echo "Time sync complete." diff --git a/features/scripts/utils/nomarchy-upload-log b/features/scripts/utils/nomarchy-upload-log index 3e04401..33a9795 100755 --- a/features/scripts/utils/nomarchy-upload-log +++ b/features/scripts/utils/nomarchy-upload-log @@ -13,9 +13,15 @@ fi # Use ix.io as the default pastebin if [[ -n $1 ]]; then - url=$(curl -F "f:1=@$1" ix.io) + # --connect-timeout 5: fail fast if ix.io is unreachable + url=$(curl -s --connect-timeout 5 -F "f:1=@$1" ix.io || echo "OFFLINE") else - url=$(curl -F "f:1=@-" ix.io) + url=$(curl -s --connect-timeout 5 -F "f:1=@-" ix.io || echo "OFFLINE") +fi + +if [[ "$url" == "OFFLINE" ]]; then + echo "Error: Could not upload log. Check your internet connection." + exit 1 fi echo "Log uploaded to: $url"