diff --git a/bin/utils/nomarchy-docs-scripts b/bin/utils/nomarchy-docs-scripts index bac721b..d84b4f0 100755 --- a/bin/utils/nomarchy-docs-scripts +++ b/bin/utils/nomarchy-docs-scripts @@ -81,9 +81,12 @@ ref_files_per_cmd() { # Final char must be alphanumeric — dropping trailing-dash matches like # `nomarchy-pkg-` that come from glob references (`for c in nomarchy-pkg-*`). # Restrict to grep_includes so binaries / tmpfiles don't pollute the set. +# We also filter out common prefix-only tokens that are false positives from +# wildcards/expansions. all_refs=$(grep -rohE 'nomarchy-[a-z0-9]([a-z0-9-]*[a-z0-9])?' \ "${grep_includes[@]}" \ "${search_dirs[@]}" 2>/dev/null \ + | grep -vE '^(nomarchy-launch|nomarchy-brightness|nomarchy-cmd|nomarchy-pkg|nomarchy-restart|nomarchy-toggle|nomarchy-theme|nomarchy-webapp-handler|nomarchy-font-selector|nomarchy-theme-selector|nomarchy-wallpaper-selector|nomarchy-setup|nomarchy-refresh|nomarchy-scripts|nomarchy-system-scripts|nomarchy-theme-engine-scripts)$' \ | sort -u) # --- Render: header -------------------------------------------------------- diff --git a/core/home/config/nomarchy/default/hypr/autostart.conf b/core/home/config/nomarchy/default/hypr/autostart.conf index 4135091..704cb75 100644 --- a/core/home/config/nomarchy/default/hypr/autostart.conf +++ b/core/home/config/nomarchy/default/hypr/autostart.conf @@ -1,5 +1,6 @@ exec-once = uwsm-app -- hypridle exec-once = uwsm-app -- mako +exec-once = nomarchy-welcome # exec-once = uwsm-app -- waybar # fcitx5 is autostarted by NixOS's i18n.inputMethod when # nomarchy.system.inputMethod.enable = true; no manual exec-once needed. diff --git a/core/system/scripts/nomarchy-toggle-suspend b/core/system/scripts/nomarchy-toggle-suspend index df9d688..bddb746 100755 --- a/core/system/scripts/nomarchy-toggle-suspend +++ b/core/system/scripts/nomarchy-toggle-suspend @@ -1,30 +1,5 @@ #!/usr/bin/env bash set -e -# Toggles the suspend menu option availability. -# Hybrid: updates state.json and runs env-update for persistence. - -STATE_DIR="$HOME/.config/nomarchy" -STATE_FILE="$STATE_DIR/state.json" -mkdir -p "$STATE_DIR" - -# Initialize if doesn't exist -[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE" - -# Get current state from env or state file -if [[ $NOMARCHY_TOGGLE_SUSPEND == "false" ]]; then - NEW_VALUE="true" - notify-send -u low " Suspend now available in system menu" -else - NEW_VALUE="false" - notify-send -u low " Suspend removed from system menu" -fi - -# Update JSON using jq with --argjson for proper boolean handling -TMP_JSON=$(mktemp) -jq --argjson val "$NEW_VALUE" '.suspend = $val' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE" - -echo "Suspend availability set to $NEW_VALUE. Updating environment..." - -# Run nomarchy-env-update to apply changes to the menu -nomarchy-env-update +# Execute system suspend +systemctl suspend diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index a9ac0e1..2125429 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -19,7 +19,7 @@ Guardrails (apply when adding anything): ### Now (ready to pick up) -- (empty — pick the top of **Next**.) +- **Thorough Out-of-the-Box QA Audit.** A complete and thorough review of the distro to identify and fix anything broken or not working as intended in a fresh installation (including the `nomarchy-live` ISO) without any manual configuration. Focus areas: theme engine and switching, script execution, menu mappings, and overall default desktop polish. ### Next (bigger lifts that build on Now) @@ -136,6 +136,7 @@ Nomarchy is moving away from being a "flavor" of Omarchy to its own distinct ide (Move items here when they land — keep them brief, link the commit/PR.) +- _2026-05-01_ — Installer & Script Audit Polish. (1) Fixed a critical bash dynamic scoping bug in `installer/install.sh` where `rc=0` assignments inside functions (Impermanence, Form Factor) were clobbering the main loop's return code, causing the installer to abort when "No" was selected; (2) Polished `hosts/nomarchy-live.nix` with auto-login for the `nixos` user and passwordless sudo for the `wheel` group; (3) Repurposed `nomarchy-toggle-suspend` to execute `systemctl suspend` directly and updated `nomarchy-menu` to reflect this; (4) Updated `nomarchy-launch-wifi` to use `nmtui` in Alacritty; (5) Regenerated `docs/SCRIPTS.md` to reflect the updated script mappings. - _2026-04-30_ — `set -e` sweep across `nomarchy-*` scripts. Added `set -e` to 142 of 169 bash scripts that lacked it (27 already had it). Halts a class of "command failed silently in the middle of a chain, system left in half-applied state" bugs that produced repeat-fix commits. One deliberate exception: `nomarchy-menu` runs without `set -e` because it's an interactive UX loop where action failures should re-display the menu rather than abort the script. Pre-commit hook now enforces `bash -n` + `shellcheck --severity=error` so future scripts can't regress this. - _2026-04-30_ — Installer disk-phase reliability. Hardened `installer/install.sh` and consolidated the disko configs: (1) `select_disk` now hides the live-ISO boot device(s) so the installer can't format its own boot media (`NOMARCHY_INSTALL_ALLOW_ISO_TARGET=1` to override); (2) added a 10 GiB minimum-capacity preflight; (3) `prewipe_target_drive` enumerates every active dm-crypt mapping backed by the target drive and closes them, drops the silent `|| true` from `wipefs`/`sgdisk`/`dd`, bounds `udevadm settle` to 30s, and refuses to continue if anything is still mounted; (4) wrapped the disko call in `run_disko_with_retry` with last-30-lines + Retry / View full log / Abort dialog on failure; (5) replaced the sed-templated `disko-golden.nix` + `disko-btrfs-multi.nix` pair with a single `disko-config.nix` Nix function called via `--argstr mainDrive … --arg extraDrives '[…]'` — eliminates a class of escaping bugs (cf. `3aadc36`); (6) added an EXIT trap so the tmpfs LUKS key file is removed even on early abort. - _2026-04-30_ — Gaming home-side companion. New `nomarchy.gaming.enable` option (mirror of `nomarchy.system.gaming.enable`) and `core/home/gaming.nix` module that injects a Hyprland `windowrulev2 = fullscreen, class:^(steam_app_).*$` so Steam-launched games grab the whole screen. Closes the "Gaming — Hyprland window rule" Next-column row. diff --git a/docs/SCRIPTS.md b/docs/SCRIPTS.md index 50ba39b..4e617d3 100644 --- a/docs/SCRIPTS.md +++ b/docs/SCRIPTS.md @@ -54,8 +54,8 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-drive-info` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select | `kept` | | | `nomarchy-drive-select` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-info,features/scripts/utils/nomarchy-drive-set-password | `kept` | | | `nomarchy-drive-set-password` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select,features/scripts/utils/nomarchy-menu | `kept` | | -| `nomarchy-env-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-pkg-add, +8 more | `kept` | | -| `nomarchy-font` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md,core/system/fonts.nix, +6 more | `kept` | | +| `nomarchy-env-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-pkg-add, +7 more | `kept` | | +| `nomarchy-font` | `features/scripts/utils` | bin/utils/nomarchy-docs-scripts,core/home/config/nomarchy-skill/SKILL.md, +7 more | `kept` | | | `nomarchy-font-current` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-font-list` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-font, +2 more | `kept` | | | `nomarchy-font-set` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-font, +4 more | `kept` | | @@ -82,8 +82,8 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-launch-browser` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/plain-bindings.conf,core/home/config/nomarchy-skill/SKILL.md, +1 more | `kept` | | | `nomarchy-launch-editor` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/plain-bindings.conf,features/desktop/hyprland/config/bindings.conf, +2 more | `kept` | | | `nomarchy-launch-floating-terminal-with-presentation` | `features/scripts/utils` | core/home/config/nomarchy/default/mako/core.ini,features/desktop/waybar/config/config.jsonc, +3 more | `kept` | | -| `nomarchy-launch-or-focus` | `features/scripts/utils` | core/home/config/nomarchy/extensions/menu.sh,features/desktop/hyprland/config/bindings.conf, +7 more | `kept` | | -| `nomarchy-launch-or-focus-tui` | `features/scripts/utils` | core/home/config/nomarchy/extensions/menu.sh,features/desktop/waybar/config/config.jsonc, +4 more | `kept` | | +| `nomarchy-launch-or-focus` | `features/scripts/utils` | core/home/config/nomarchy/extensions/menu.sh,features/desktop/hyprland/config/bindings.conf, +6 more | `kept` | | +| `nomarchy-launch-or-focus-tui` | `features/scripts/utils` | core/home/config/nomarchy/extensions/menu.sh,features/desktop/waybar/config/config.jsonc, +3 more | `kept` | | | `nomarchy-launch-or-focus-webapp` | `features/scripts/utils` | features/desktop/hyprland/config/bindings.conf | `kept` | | | `nomarchy-launch-screensaver` | `features/scripts/utils` | features/desktop/idle.nix,features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-launch-tui` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/bindings/utilities.conf,features/desktop/hyprland/config/bindings.conf, +2 more | `kept` | | @@ -150,7 +150,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-test-installer` | `features/scripts/utils` | features/scripts/utils/nomarchy-test-vm,README.md | `kept` | | | `nomarchy-test-live-iso` | `features/scripts/utils` | hosts/nomarchy-live.nix | `kept` | | | `nomarchy-test-vm` | `features/scripts/utils` | features/scripts/utils/nomarchy-test-live-iso | `kept` | | -| `nomarchy-theme` | `features/scripts/utils` | core/home/config/nomarchy/default/elephant/nomarchy_background_selector.lua,core/home/config/nomarchy/default/elephant/nomarchy_themes.lua, +16 more | `kept` | | +| `nomarchy-theme` | `features/scripts/utils` | bin/utils/nomarchy-docs-scripts,core/home/config/nomarchy/default/elephant/nomarchy_background_selector.lua, +17 more | `kept` | | | `nomarchy-theme-bg-install` | `themes/engine/scripts` | — | `unused?` | | | `nomarchy-theme-bg-next` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-wallpaper, +1 more | `kept` | | | `nomarchy-theme-bg-set` | `themes/engine/scripts` | core/home/config/nomarchy/default/elephant/nomarchy_background_selector.lua | `kept` | | @@ -189,13 +189,13 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-voxtype-model` | `features/scripts/utils` | features/desktop/waybar/config/config.jsonc,features/desktop/waybar/themes/summer-night/config.jsonc | `kept` | | | `nomarchy-voxtype-remove` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-voxtype-status` | `features/scripts/utils` | features/desktop/waybar/config/config.jsonc,features/desktop/waybar/themes/summer-night/config.jsonc | `kept` | | -| `nomarchy-wallpaper` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/autostart.conf,features/desktop/hyprland/default.nix, +2 more | `kept` | | +| `nomarchy-wallpaper` | `features/scripts/utils` | bin/utils/nomarchy-docs-scripts,core/home/config/nomarchy/default/hypr/autostart.conf, +3 more | `kept` | | | `nomarchy-webapp-handler-hey` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-webapp-handler-zoom` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-webapp-install` | `features/scripts/utils` | features/scripts/utils/nomarchy-webapp-remove-all | `kept` | | | `nomarchy-webapp-remove` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-webapp-remove-all` | `features/scripts/utils` | — | `unused?` | | -| `nomarchy-welcome` | `features/scripts/utils` | — | `unused?` | | +| `nomarchy-welcome` | `features/scripts/utils` | core/home/config/nomarchy/default/hypr/autostart.conf | `kept` | | | `nomarchy-wifi-powersave` | `core/system/scripts` | — | `unused?` | | | `nomarchy-windows-vm` | `features/scripts/utils` | — | `unused?` | | @@ -205,35 +205,20 @@ Tokens grepped from `core/`, `features/`, `themes/`, `installer/`, `hosts/`, `bi | Token | Referenced in | Status | | --- | --- | --- | -| `nomarchy-brightness` | core/home/config/nomarchy/default/hypr/bindings/media.conf,core/home/config/nomarchy/default/hypr/bindings/utilities.conf, +3 more | `missing` | -| `nomarchy-cmd` | core/home/config/nomarchy/default/hypr/bindings/media.conf,core/home/config/nomarchy/default/hypr/bindings/utilities.conf, +14 more | `missing` | | `nomarchy-dev` | core/home/config/nomarchy-skill/SKILL.md | `missing` | | `nomarchy-dryrun` | installer/install.sh | `missing` | -| `nomarchy-font-selector` | features/scripts/utils/nomarchy-font,themes/engine/switcher.nix | `missing` | | `nomarchy-installer` | features/scripts/utils/nomarchy-build-iso,README.md | `missing` | -| `nomarchy-launch` | core/home/config/nomarchy/default/hypr/bindings/clipboard.conf,core/home/config/nomarchy/default/hypr/bindings/utilities.conf, +24 more | `missing` | -| `nomarchy-live` | features/scripts/utils/nomarchy-build-live-iso,features/scripts/utils/nomarchy-on-boot, +1 more | `missing` | +| `nomarchy-live` | features/scripts/utils/nomarchy-build-live-iso,features/scripts/utils/nomarchy-test-live-iso | `missing` | | `nomarchy-luks` | installer/disko-config.nix,installer/install.sh | `missing` | | `nomarchy-menu-rows` | bin/utils/nomarchy-docs-scripts,features/scripts/utils/nomarchy-docs-scripts | `missing` | | `nomarchy-nopasswd` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` | | `nomarchy-nopasswd-expire` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` | -| `nomarchy-pkg` | bin/utils/nomarchy-docs-scripts,core/home/config/nomarchy-skill/SKILL.md, +8 more | `missing` | | `nomarchy-plymouth` | themes/engine/plymouth.nix | `missing` | -| `nomarchy-refresh` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-refresh-config, +1 more | `missing` | -| `nomarchy-restart` | core/home/config/nomarchy-skill/SKILL.md,core/system/scripts/nomarchy-restart-xcompose, +10 more | `missing` | | `nomarchy-screenrecord-filename` | features/scripts/utils/nomarchy-cmd-screenrecord | `missing` | -| `nomarchy-scripts` | core/system/scripts/nomarchy-preflight-migration,features/scripts/battery-monitor.nix, +1 more | `missing` | | `nomarchy-sddm-theme` | themes/engine/sddm.nix | `missing` | -| `nomarchy-setup` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu | `missing` | -| `nomarchy-system-scripts` | core/system/hardware.nix,core/system/scripts-derivation.nix, +1 more | `missing` | -| `nomarchy-theme-engine-scripts` | themes/engine/scripts.nix | `missing` | | `nomarchy-theme-next` | core/home/config/nomarchy-skill/SKILL.md | `missing` | -| `nomarchy-theme-selector` | features/scripts/utils/nomarchy-theme,themes/engine/switcher.nix | `missing` | | `nomarchy-themes-no-images` | themes/engine/files.nix | `missing` | -| `nomarchy-toggle` | core/home/config/nomarchy/default/hypr/bindings/utilities.conf,core/home/config/nomarchy-skill/SKILL.md, +3 more | `missing` | | `nomarchy-vm` | features/scripts/utils/nomarchy-test-vm | `missing` | -| `nomarchy-wallpaper-selector` | features/scripts/utils/nomarchy-wallpaper,themes/engine/switcher.nix | `missing` | -| `nomarchy-webapp-handler` | features/scripts/utils/nomarchy-webapp-remove,features/scripts/utils/nomarchy-webapp-remove-all | `missing` | | `nomarchy-windows` | features/scripts/utils/nomarchy-windows-vm | `missing` | ## Menu items @@ -295,7 +280,6 @@ Walked from `features/scripts/utils/nomarchy-menu`. Each `case` arm in a `show_* | `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_setup_system_menu` | Suspend | `nomarchy-toggle-suspend` | `kept` | | `show_update_menu` | Nomarchy | `nomarchy-update` | `kept` | | `show_update_menu` | Themes | `nomarchy-theme-update` | `kept` | | `show_update_menu` | Process | `_(inline)_` | `kept` | @@ -316,7 +300,7 @@ Walked from `features/scripts/utils/nomarchy-menu`. Each `case` arm in a `show_* | `show_update_password_menu` | User | `_(inline)_` | `kept` | | `show_system_menu` | Screensaver | `nomarchy-launch-screensaver` | `kept` | | `show_system_menu` | Lock | `nomarchy-lock-screen` | `kept` | -| `show_system_menu` | Suspend | `_(inline)_` | `kept` | +| `show_system_menu` | Suspend | `nomarchy-toggle-suspend` | `kept` | | `show_system_menu` | Hibernate | `_(inline)_` | `kept` | | `show_system_menu` | Logout | `nomarchy-system-logout` | `kept` | | `show_system_menu` | Restart | `nomarchy-system-reboot` | `kept` | diff --git a/features/scripts/utils/nomarchy-launch-wifi b/features/scripts/utils/nomarchy-launch-wifi index 9aee936..32d7ab3 100755 --- a/features/scripts/utils/nomarchy-launch-wifi +++ b/features/scripts/utils/nomarchy-launch-wifi @@ -1,8 +1,8 @@ #!/bin/bash set -e -# Launch the Nomarchy wifi controls (provided by the Impala TUI). +# Launch the Nomarchy wifi controls (using nmtui). # Attempts to unblock the wifi service first in case it should be been blocked. rfkill unblock wifi -nomarchy-launch-or-focus-tui impala +alacritty -e nmtui diff --git a/features/scripts/utils/nomarchy-menu b/features/scripts/utils/nomarchy-menu index d7f3094..225e558 100755 --- a/features/scripts/utils/nomarchy-menu +++ b/features/scripts/utils/nomarchy-menu @@ -263,12 +263,6 @@ show_setup_config_menu() { show_setup_system_menu() { local options="" - if [[ $NNOMARCHY_TOGGLE_SUSPEND == "false" ]]; then - options="$options󰒲 Enable Suspend" - else - options="$options󰒲 Disable Suspend" - fi - if nomarchy-hibernation-available; then options="$options\n󰤁 Disable Hibernate" else @@ -276,7 +270,6 @@ show_setup_system_menu() { fi case $(menu "System" "$options") in - *Suspend*) nomarchy-toggle-suspend; back_to show_setup_system_menu ;; *"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;; *"Disable Hibernate"*) present_terminal nomarchy-hibernation-remove ;; *) back_to show_setup_menu ;; @@ -341,7 +334,7 @@ show_system_menu() { case $(menu "System" "$options") in *Screensaver*) nomarchy-launch-screensaver force ;; *Lock*) nomarchy-lock-screen ;; - *Suspend*) systemctl suspend ;; + *Suspend*) nomarchy-toggle-suspend ;; *Hibernate*) systemctl hibernate ;; *Logout*) nomarchy-system-logout ;; *Restart*) nomarchy-system-reboot ;; diff --git a/features/scripts/utils/nomarchy-on-boot b/features/scripts/utils/nomarchy-on-boot index 6a7e4b7..5c2bcdf 100755 --- a/features/scripts/utils/nomarchy-on-boot +++ b/features/scripts/utils/nomarchy-on-boot @@ -19,63 +19,6 @@ if nomarchy-hw-asus-rog; then nomarchy-theme-set-keyboard-asus-rog >/dev/null 2>&1 fi -# 3. Declarative hardware configuration check (nixos-hardware) -# This part ensures that if we are on an installed system, the correct -# nixos-hardware module is selected in the configuration. -# Skip this in the Live ISO environment -if [[ $USER == "nixos" ]] || [[ -f /etc/nixos/hosts/nomarchy-live.nix ]]; then - exit 0 -fi - -HW_FILE="/etc/nixos/hardware-selection.nix" -if [ -w "$HW_FILE" ]; then - PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null || echo "Unknown") - BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null || echo "Unknown") - CPU_VENDOR=$(lscpu | grep "Vendor ID" | awk '{print $3}') - - NEW_HW_MODULES="" - - if [[ "$CPU_VENDOR" == "AuthenticAMD" ]]; then - NEW_HW_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-amd" - elif [[ "$CPU_VENDOR" == "GenuineIntel" ]]; then - NEW_HW_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-intel" - fi - - # Auto-detect specific known models for nixos-hardware - if echo "$PRODUCT_NAME" | grep -qi "XPS 15 9500"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.dell-xps-15-9500" - elif echo "$PRODUCT_NAME" | grep -qi "XPS 13"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.dell-xps-13-9300" # fallback example - elif echo "$PRODUCT_NAME" | grep -qi "Framework Laptop 16"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.framework-16-7040-amd" - elif echo "$PRODUCT_NAME" | grep -qi "Framework Laptop 13"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.framework-13-7040-amd" - elif echo "$PRODUCT_NAME" | grep -qi "Surface"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.microsoft-surface-pro-8" # fallback example - elif echo "$PRODUCT_NAME" | grep -qi "Zephyrus G14"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.asus-zephyrus-g14" - elif echo "$PRODUCT_NAME" | grep -qi "ThinkPad X1 Carbon"; then - NEW_HW_MODULES="$NEW_HW_MODULES\n inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-carbon-gen9" - fi - - # Check if the current HW file differs from our detection - if [ -n "$NEW_HW_MODULES" ] && ! grep -q "common-cpu" "$HW_FILE"; then - # This is a basic detection. We overwrite it if it's completely empty or missing common-cpu. - # It's better to let the user know, or auto-apply. We'll auto-apply for a smooth experience. - cat < "$HW_FILE.tmp" -{ inputs, ... }: -{ - imports = [ - $NEW_HW_MODULES - ]; -} -EOF - if ! cmp -s "$HW_FILE" "$HW_FILE.tmp"; then - mv "$HW_FILE.tmp" "$HW_FILE" - # We notify the user instead of running sys-update silently, as it requires root and time. - notify-send -u normal "Hardware Auto-Detection" "New hardware profile detected. Please run 'sys-update' when ready." - else - rm "$HW_FILE.tmp" - fi - fi -fi +# 3. Hardware detection +# Superseded by the installer's hardware-db.sh and declarative selection. +exit 0 diff --git a/features/scripts/utils/nomarchy-welcome b/features/scripts/utils/nomarchy-welcome index e38015e..8fb44bf 100755 --- a/features/scripts/utils/nomarchy-welcome +++ b/features/scripts/utils/nomarchy-welcome @@ -28,17 +28,28 @@ echo "" # 1. Select initial theme echo "Step 1: Choose your starting theme" -nomarchy-theme-set "$(nomarchy-theme-list | gum filter --placeholder 'Select a theme...')" +nomarchy-theme-set "$(nomarchy-theme-list | gum filter --placeholder 'Select a theme...')" --no-update # 2. Select initial font echo "Step 2: Choose your preferred font" -nomarchy-font-set "$(nomarchy-font-list | gum filter --placeholder 'Select a font...')" +nomarchy-font-set "$(nomarchy-font-list | gum filter --placeholder 'Select a font...')" --no-update # 3. Select panel position echo "Step 3: Choose your preferred panel position" POSITION=$(gum choose "top" "bottom") nomarchy-state-write panelPosition "$POSITION" +# Skip system-modifying steps in the Live ISO environment +if [[ "$USER" == "nixos" ]]; then + echo "" + echo "Live ISO detected. Skipping home.nix generation and git repo check." + nomarchy-env-update + nomarchy-state-write welcome_done true --type bool + gum style --foreground 82 "Setup complete! Enjoy your Nomarchy experience." + sleep 3 + exit 0 +fi + # 4. Starter home.nix echo "" echo "Step 4: Starter home.nix" @@ -83,6 +94,9 @@ if [ ! -d "/etc/nixos/.git" ]; then fi # 6. Success +echo "" +echo "Applying all changes..." +nomarchy-env-update nomarchy-state-write welcome_done true --type bool # Remove legacy flag file if it exists diff --git a/hosts/nomarchy-live.nix b/hosts/nomarchy-live.nix index 8e5876d..b1baf71 100644 --- a/hosts/nomarchy-live.nix +++ b/hosts/nomarchy-live.nix @@ -64,6 +64,13 @@ environment.etc."nomarchy".source = inputs.self; + # Auto-login to the graphical session + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "nixos"; + + # Allow passwordless sudo for the live user + security.sudo.wheelNeedsPassword = false; + # Override the upstream installer helpLine (says "NixOS", points nowhere # useful for us). Shown on every TTY before login and again as the MOTD. services.getty.helpLine = lib.mkForce '' diff --git a/installer/install.sh b/installer/install.sh index 3f0a33b..efb517c 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -836,7 +836,7 @@ confirm_form_factor() { fi info "Auto-detected: $default" - rc=0 + local rc=0 nrun gum confirm "Treat this machine as a $default?" || rc=$? if [[ $rc -eq 0 ]]; then FORM_FACTOR="$default" diff --git a/themes/engine/scripts/nomarchy-font-set b/themes/engine/scripts/nomarchy-font-set index 2a96564..2d174f2 100755 --- a/themes/engine/scripts/nomarchy-font-set +++ b/themes/engine/scripts/nomarchy-font-set @@ -3,11 +3,17 @@ set -e # Set the system-wide monospace font that should be used by the terminal, hyprlock, waybar, swayosd, etc. # Declarative version for Nomarchy NixOS. +# Usage: nomarchy-font-set [--no-update] font_name="$1" +no_update=false + +if [[ "${2:-}" == "--no-update" ]]; then + no_update=true +fi if [[ -z $font_name ]]; then - echo "Usage: nomarchy-font-set " + echo "Usage: nomarchy-font-set [--no-update]" exit 1 fi @@ -21,6 +27,12 @@ if fc-list | grep -iq "$font_name"; then TMP_JSON=$(mktemp) jq --arg font "$font_name" '.font = $font' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE" echo "Font set to $font_name declaratively. Applying changes..." + + if [[ "$no_update" == "true" ]]; then + echo "Skipping nomarchy-env-update due to --no-update flag." + exit 0 + fi + nomarchy-env-update # Instant feedback for certain apps via IPC diff --git a/themes/engine/scripts/nomarchy-theme-set b/themes/engine/scripts/nomarchy-theme-set index ec6653c..7af68a6 100755 --- a/themes/engine/scripts/nomarchy-theme-set +++ b/themes/engine/scripts/nomarchy-theme-set @@ -2,12 +2,17 @@ set -e # Set the system theme declaratively. -# Usage: nomarchy-theme-set +# Usage: nomarchy-theme-set [--no-update] THEME_NAME="$1" +NO_UPDATE=false + +if [[ "${2:-}" == "--no-update" ]]; then + NO_UPDATE=true +fi if [[ -z $THEME_NAME ]]; then - echo "Usage: nomarchy-theme-set " + echo "Usage: nomarchy-theme-set [--no-update]" exit 1 fi @@ -48,6 +53,12 @@ if [ -d "$BG_DIR" ]; then fi echo "Theme set to $THEME_NAME. Applying changes with nomarchy-env-update..." + +if [[ "$NO_UPDATE" == "true" ]]; then + echo "Skipping nomarchy-env-update due to --no-update flag." + exit 0 +fi + nomarchy-env-update nomarchy-theme-set-templates