From 0f22c48c45029c2b9c6ae4a2bd9f70db7e726384 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Fri, 22 May 2026 17:45:24 +0100 Subject: [PATCH] feat(welcome): show "What's installed?" summary on first boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New nomarchy-installed-summary script renders a markdown table via gum format with the install shape the user should verify before they start customising: - theme / font / panel position (~/.config/nomarchy/state.json) - timezone / DNS / hybrid GPU (/etc/nixos/state.json) - form factor (BAT* sysfs presence) - software profiles (presence of marker packages) - FDE (any crypt entry in lsblk) - drives (lsblk filtered to disk/part/crypt) nomarchy-welcome calls it as Step 0 — before the theme/font/panel pickers — and gates progression on a gum input prompt so the user has to acknowledge before customisation rewrites anything. The script is also callable standalone from any terminal: `nomarchy-installed-summary`. Self-contained — no installer-side changes. Software profiles are detected heuristically (the installer bakes the user's pick into the generated home.nix as concrete home.packages rather than persisting a profile list), which is good enough for verification but won't catch manually-removed profile packages. gum is in the existing categoryDeps so no new tools are needed; falls back to plain markdown when gum isn't on PATH (recovery contexts). Closes the "Installer: What's installed? summary on first boot" Now-column item from Pillar 4. --- docs/SCRIPTS.md | 10 +- .../scripts/utils/nomarchy-installed-summary | 99 +++++++++++++++++++ features/scripts/utils/nomarchy-welcome | 8 ++ 3 files changed, 112 insertions(+), 5 deletions(-) create mode 100755 features/scripts/utils/nomarchy-installed-summary diff --git a/docs/SCRIPTS.md b/docs/SCRIPTS.md index e2f2d12..99fd2d5 100644 --- a/docs/SCRIPTS.md +++ b/docs/SCRIPTS.md @@ -24,7 +24,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, - `delete-dead` — Phase B verdict: remove and update callers. - `stub-with-notify` — Phase B verdict: temporary `notify-send` stub. -## Scripts (159) +## Scripts (160) | Script | Location | Callers | Status | Notes | | --- | --- | --- | --- | --- | @@ -74,6 +74,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-hyprland-workspace-layout-toggle` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/bindings/tiling-v2.conf,features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-install` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,hosts/nomarchy-installer.nix, +2 more | `kept` | | | `nomarchy-install-docker-dbs` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | +| `nomarchy-installed-summary` | `features/scripts/utils` | features/scripts/utils/nomarchy-welcome | `kept` | | | `nomarchy-launch-about` | `features/scripts/utils` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-launch-audio` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/bindings/utilities.conf,features/desktop/waybar/config/config.jsonc, +2 more | `kept` | | | `nomarchy-launch-bluetooth` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/bindings/utilities.conf,features/desktop/waybar/config/config.jsonc, +1 more | `kept` | | @@ -174,7 +175,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-update-firmware` | `features/scripts/utils` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-update-time` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-upload-log` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-debug | `kept` | | -| `nomarchy-version` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-debug | `kept` | | +| `nomarchy-version` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-debug, +1 more | `kept` | | | `nomarchy-voxtype-config` | `features/scripts/utils` | features/desktop/waybar/config/config.jsonc,features/desktop/waybar/themes/summer-night/config.jsonc | `kept` | | | `nomarchy-voxtype-install` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | | `nomarchy-voxtype-model` | `features/scripts/utils` | features/desktop/waybar/config/config.jsonc,features/desktop/waybar/themes/summer-night/config.jsonc | `kept` | | @@ -184,7 +185,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-webapp-install` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-webapp-remove-all | `kept` | | | `nomarchy-webapp-remove` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | | `nomarchy-webapp-remove-all` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | -| `nomarchy-welcome` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/autostart.conf,lib/state-schema.nix | `kept` | | +| `nomarchy-welcome` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/autostart.conf,features/scripts/utils/nomarchy-installed-summary, +1 more | `kept` | | | `nomarchy-wifi-powersave` | `core/system/scripts` | features/scripts/utils/nomarchy-sys-update,installer/install.sh | `kept` | | | `nomarchy-windows-vm` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | @@ -202,7 +203,7 @@ Walked from `features/scripts/utils/nomarchy-menu`. Each `case` arm in a `show_* | Submenu | Entry | Calls | Status | | --- | --- | --- | --- | | `show_learn_menu` | Keybindings | `nomarchy-menu-keybindings` | `kept` | -| `show_learn_menu` | Nomarchy | `nomarchy-launch-webapp` | `kept` | +| `show_learn_menu` | Nomarchy | `nomarchy-manual` | `kept` | | `show_learn_menu` | Hyprland | `nomarchy-launch-webapp` | `kept` | | `show_learn_menu` | Arch | `nomarchy-launch-webapp` | `kept` | | `show_learn_menu` | Bash | `nomarchy-launch-webapp` | `kept` | @@ -253,7 +254,6 @@ Walked from `features/scripts/utils/nomarchy-menu`. Each `case` arm in a `show_* | `show_setup_config_menu` | Walker | `nomarchy-restart-walker` | `kept` | | `show_setup_config_menu` | Waybar | `nomarchy-restart-waybar` | `kept` | | `show_setup_config_menu` | XCompose | `nomarchy-restart-xcompose` | `kept` | -| `show_setup_config_menu` | Overrides | `_(inline)_` | `kept` | | `show_update_menu` | Nomarchy | `nomarchy-update` | `kept` | | `show_update_menu` | Themes | `nomarchy-theme-update` | `kept` | | `show_update_menu` | Process | `_(inline)_` | `kept` | diff --git a/features/scripts/utils/nomarchy-installed-summary b/features/scripts/utils/nomarchy-installed-summary new file mode 100755 index 0000000..0363912 --- /dev/null +++ b/features/scripts/utils/nomarchy-installed-summary @@ -0,0 +1,99 @@ +#!/usr/bin/env bash +set -e + +# Print a curated "what the installer wrote" summary so the user can verify +# the system shape on first boot before they start customising. Reads from +# state.json where the schema persists the value, and falls back to live +# introspection for things the schema doesn't track (form factor, drives, +# active software profiles, FDE). +# +# Invoked as Step 0 of nomarchy-welcome and available as a standalone CLI. + +HOME_STATE="$HOME/.config/nomarchy/state.json" +SYS_STATE="/etc/nixos/state.json" + +jq_or_empty() { + local file="$1" + local query="$2" + [[ -f "$file" ]] || { echo ""; return; } + jq -r "$query // empty" "$file" 2>/dev/null || echo "" +} + +theme=$(jq_or_empty "$HOME_STATE" '.theme') +font=$(jq_or_empty "$HOME_STATE" '.font') +panel=$(jq_or_empty "$HOME_STATE" '.panelPosition') +tz=$(jq_or_empty "$SYS_STATE" '.timezone') +dns=$(jq_or_empty "$SYS_STATE" '.dns') +hybrid_gpu=$(jq_or_empty "$SYS_STATE" '.features.hybridGPU') + +# Form factor: same battery-presence check the installer uses to auto-set +# nomarchy.{system.,}formFactor. +if compgen -G "/sys/class/power_supply/BAT*" >/dev/null; then + form_factor="laptop" +else + form_factor="desktop" +fi + +# Active software profiles: heuristic detection. The installer bakes the +# user's pick into the generated home.nix as concrete `home.packages` / +# system toggles rather than persisting a profile list, so we check for +# the marker package of each profile. +profiles=() +command -v docker >/dev/null 2>&1 && profiles+=("Dev") +command -v steam >/dev/null 2>&1 && profiles+=("Gaming") +command -v libreoffice >/dev/null 2>&1 && profiles+=("Office") +command -v obs >/dev/null 2>&1 && profiles+=("Media") +command -v rg >/dev/null 2>&1 && profiles+=("CLI Utils") + +profiles_str="None" +if (( ${#profiles[@]} > 0 )); then + profiles_str="$(IFS=', '; echo "${profiles[*]}")" +fi + +# FDE: any crypt device present means the install used LUKS. +luks="No" +if lsblk -no TYPE 2>/dev/null | grep -q '^crypt$'; then + luks="Yes" +fi + +# Drives: target disks + their mounted root/boot/crypt partitions. Filter +# noise (loop/rom/zram) so the table reads like an install receipt. +drives=$(lsblk -no NAME,SIZE,TYPE,MOUNTPOINT 2>/dev/null \ + | grep -Ev '^(loop|sr|zram)' \ + | awk 'NF>=3 && $3 ~ /^(disk|part|crypt)$/' \ + || true) + +version_line=$(nomarchy-version 2>/dev/null || echo "Nomarchy") +hostname_line="$(hostname 2>/dev/null || echo "")" + +# Render via gum format (markdown). Fallback to plain text when gum isn't +# on PATH — keeps the script callable from minimal contexts like recovery. +render() { + cat </dev/null 2>&1; then + render | gum format +else + render +fi diff --git a/features/scripts/utils/nomarchy-welcome b/features/scripts/utils/nomarchy-welcome index bf30367..9093687 100755 --- a/features/scripts/utils/nomarchy-welcome +++ b/features/scripts/utils/nomarchy-welcome @@ -26,6 +26,14 @@ gum style \ echo "Welcome! Let's personalize your new system." echo "" +# 0. Show what the installer actually wrote so the user can verify the +# install shape (theme, font, profiles, drives, FDE, form factor) before +# diving into customisation. Available standalone via the same command. +nomarchy-installed-summary +echo "" +gum input --placeholder "Press Enter to continue with customisation…" >/dev/null || true +echo "" + # 1. Select initial theme echo "Step 1: Choose your starting theme" SELECTED_THEME="$(nomarchy-theme-list | gum filter --placeholder 'Select a theme...')"