refactor: implement component-based architecture for enhanced maintainability

- Reorganize directory structure into core/, features/, and themes/
- Colocate application Nix logic, configs, scripts, and theme overrides
- Implement 'Inversion of Control' for theming: apps now pull theme-specific layouts
- Update flake.nix and shared library paths to match the new structure
- Document the new Feature-Centric architecture in README.md
This commit is contained in:
Bernardo Magri
2026-04-12 14:51:15 +01:00
parent a9ee79a5ce
commit bbdf34ced8
535 changed files with 119 additions and 127 deletions

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
FLAG_FILE="$HOME/.config/nomarchy/.first-run-done"
if [ -f "$FLAG_FILE" ]; then
exit 0
fi
# Ensure we have a terminal for the wizard
if [ -z "$TERMINAL_WIZARD" ]; then
export TERMINAL_WIZARD=1
alacritty -e "$0"
exit 0
fi
gum style \
--foreground 212 --border-foreground 212 --border double \
--align center --width 50 --margin "1 2" --padding "2 4" \
"Nomarchy" "The NixOS Distribution with Nomarchy Flavour"
echo "Welcome! Let's personalize your new system."
echo ""
# 1. Select initial theme
echo "Step 1: Choose your starting theme"
nomarchy-theme-set "$(nomarchy-theme-list | gum filter --placeholder 'Select a theme...')"
# 2. Select initial font
echo "Step 2: Choose your preferred font"
nomarchy-font-set "$(nomarchy-font-list | gum filter --placeholder 'Select a font...')"
# 3. Setup Local Repo (Crucial for env-update to work)
echo ""
echo "Nomarchy relies on a local git repository for declarative updates."
if [ ! -d "/etc/nixos/.git" ]; then
echo "Warning: /etc/nixos is not a git repository. Declarative updates might fail."
if gum confirm "Would you like to initialize /etc/nixos as a git repo?"; then
sudo git -C /etc/nixos init
sudo git -C /etc/nixos add .
sudo git -C /etc/nixos commit -m "Initial Nomarchy System Commit"
fi
fi
# 4. Success
mkdir -p "$(dirname "$FLAG_FILE")"
touch "$FLAG_FILE"
gum style --foreground 82 "Setup complete! Enjoy your Nomarchy experience."
sleep 3