#!/usr/bin/env bash # config.sh - Configuration and argument handling for archangel installer # Source this file after common.sh ############################# # Global Config Variables ############################# CONFIG_FILE="" UNATTENDED=false # These get populated by config file or interactive prompts. # Optional fields carry their default value here so config.sh is the # single source of truth — gather_input trusts what's loaded. FILESYSTEM="zfs" # "zfs" or "btrfs" LOCALE="en_US.UTF-8" KEYMAP="us" ENABLE_SSH="yes" # SSH with root login (default yes for headless) NO_ENCRYPT="no" # Skip filesystem encryption (testing only) # Required fields — installer errors out if any are still empty at install time. HOSTNAME="" TIMEZONE="" SELECTED_DISKS=() RAID_LEVEL="" WIFI_SSID="" WIFI_PASSWORD="" ZFS_PASSPHRASE="" LUKS_PASSPHRASE="" ROOT_PASSWORD="" ############################# # Argument Parsing ############################# parse_args() { while [[ $# -gt 0 ]]; do case "$1" in --config-file) if [[ -n "$2" && ! "$2" =~ ^- ]]; then CONFIG_FILE="$2" shift 2 else error "--config-file requires a path argument" fi ;; --color) enable_color shift ;; --help|-h) show_usage exit 0 ;; *) error "Unknown option: $1 (use --help for usage)" ;; esac done } show_usage() { cat <