nevaforget 971a6eb577 refactor(install): restore fresh-install flow, drop transform.sh and personas
Long-standing gaps in post-install.sh plus cleanup:

- post-install.sh:18 was `sudo pacman -S paru` on the wrong
  assumption paru had landed in [extra]. Verified: paru/paru-bin
  are AUR-only. Restored the original git-clone + makepkg
  bootstrap, added the rust buildep that archinstall does not
  pull in.
- post-install.sh never installed AUR extras — walker, elephant,
  waypaper, stasis, themes all silently skipped. Now pulls
  packages/aur.txt after moonarch-git.
- packages/official.txt: drop glab, go, npm (unused) and rustup
  (only needed for the paru build, handled imperatively now).
- packages/aur.txt: add walker-bin (was missing entirely).
- transform.sh + legacy update.sh shim removed — transform was
  never used in practice.
- Apollo persona block out of CLAUDE.md, prior DECISIONS entries
  rewritten from Apollo/Ragnar to ClaudeCode.
- README Transform section and scripts/ listing trimmed.
- lib.sh ABOUTME updated — only post-install.sh sources it now.
2026-04-21 09:04:23 +02:00

46 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# ABOUTME: Shared helper functions and constants for Moonarch scripts.
# ABOUTME: Sourced by post-install.sh.
# Path constants — BASH_SOURCE[1] resolves to the calling script, not lib.sh itself.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[1]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
OFFICIAL_PACKAGES="$PROJECT_DIR/packages/official.txt"
AUR_PACKAGES="$PROJECT_DIR/packages/aur.txt"
DEFAULTS_DIR="$PROJECT_DIR/defaults"
# --- Helper functions ---
log() {
echo -e "\e[1;34m[Moonarch]\e[0m $*"
}
err() {
echo -e "\e[1;31m[Moonarch ERROR]\e[0m $*" >&2
}
read_packages() {
grep -v '^\s*#' "$1" | grep -v '^\s*$'
}
confirm() {
read -r -p "$1 [y/N] " response
[[ "$response" =~ ^[yY]$ ]]
}
# --- Prerequisite checks ---
check_not_root() {
if [[ $EUID -eq 0 ]]; then
err "Do NOT run as root. The script uses sudo where needed."
exit 1
fi
}
check_pacman() {
if ! command -v pacman &>/dev/null; then
err "pacman not found — is this really Arch Linux?"
exit 1
fi
}