Modularize Post-Install Setup System #3

Merged
import_user_blakeridgway_4Umu merged 3 commits from poc/install-rewrite into master 2025-05-24 04:06:01 +00:00
import_user_blakeridgway_4Umu commented 2025-05-24 04:05:54 +00:00 (Migrated from gitlab.com)

📋 Summary

Refactored the monolithic post_install.sh script into a modular, maintainable setup system with focused, single-responsibility scripts.

🔄 Changes Made

Script Architecture

  • Replaced single large script with modular component system
  • Added main orchestrator (main-setup.sh) to coordinate execution
  • Created 5 focused scripts:
    • 00-system-prep.sh - System updates and Flathub setup
    • 01-package-install.sh - Core packages and Flatpak apps
    • 02-dev-tools-setup.sh - Development tools (Neovim, fonts, shell)
    • 03-fedora-dotnet-setup.sh - Fedora-specific .NET environment
    • 04-config-symlinks.sh - Configuration and symlinks

Package Management Improvements

  • Fixed package installation checks using rpm -q instead of unreliable dnf list installed
  • Added dynamic Fedora version detection for Microsoft repository setup
  • Replaced deprecated neofetch with fastfetch
  • Consolidated IDE installations (VS Code, JetBrains Rider) in main package script
  • Added better error handling and fallback mechanisms

Configuration Updates

  • Fixed dotfile symlinks to use correct filenames (aliases.zsh, commit-conventions.txt)
  • Improved symlink script with proper source file validation
  • Enhanced Fedora .NET setup with multiple SDK fallbacks

Documentation

  • Updated README to reflect new modular architecture
  • Documented all installed packages and post-installation tasks
  • Added clear instructions for supported distributions
  • Archived legacy script in .archive/ folder

🎯 Benefits

  • Maintainability: Each script has a single, clear responsibility
  • Debugging: Easier to isolate and fix issues in specific components
  • Flexibility: Can run individual scripts for specific setup needs
  • Reliability: Better error handling and package detection
  • Documentation: Clear understanding of what gets installed and configured

🧪 Testing

  • Tested on fresh Fedora installation
  • Verified package installation checks work correctly
  • Confirmed dotfile symlinking functions properly
  • Validated Fedora .NET setup with dynamic version detection

📁 Files Changed

├── main-setup.sh (new)
├── scripts/
│   ├── 00-system-prep.sh (new)
│   ├── 01-package-install.sh (new)
│   ├── 02-dev-tools-setup.sh (new)
│   ├── 03-fedora-dotnet-setup.sh (new)
│   └── 04-config-symlinks.sh (new)
├── .archive/
│   └── post_install.sh (moved)
└── README.md (updated)

🔧 Usage

Before:

./post_install.sh

After:

./main-setup.sh

Individual components can also be run separately:

bash scripts/01-package-install.sh
bash scripts/02-dev-tools-setup.sh

🚀 Future Improvements

  • Add support for additional Linux distributions
  • Create configuration file for customizing package lists
  • Add dry-run mode to preview changes
  • Implement logging for better troubleshooting

Checklist

  • Code follows project conventions
  • Documentation updated
  • Legacy code properly archived
  • Error handling implemented
  • Testing completed on target platform

Breaking Changes: None - the main entry point behavior remains the same, just with improved reliability and maintainability.

Migration: Users can continue using the same workflow, but now have the option to run individual setup components as needed.

### 📋 Summary Refactored the monolithic `post_install.sh` script into a modular, maintainable setup system with focused, single-responsibility scripts. ### 🔄 Changes Made #### **Script Architecture** - **Replaced** single large script with modular component system - **Added** main orchestrator (`main-setup.sh`) to coordinate execution - **Created** 5 focused scripts: - `00-system-prep.sh` - System updates and Flathub setup - `01-package-install.sh` - Core packages and Flatpak apps - `02-dev-tools-setup.sh` - Development tools (Neovim, fonts, shell) - `03-fedora-dotnet-setup.sh` - Fedora-specific .NET environment - `04-config-symlinks.sh` - Configuration and symlinks #### **Package Management Improvements** - **Fixed** package installation checks using `rpm -q` instead of unreliable `dnf list installed` - **Added** dynamic Fedora version detection for Microsoft repository setup - **Replaced** deprecated `neofetch` with `fastfetch` - **Consolidated** IDE installations (VS Code, JetBrains Rider) in main package script - **Added** better error handling and fallback mechanisms #### **Configuration Updates** - **Fixed** dotfile symlinks to use correct filenames (`aliases.zsh`, `commit-conventions.txt`) - **Improved** symlink script with proper source file validation - **Enhanced** Fedora .NET setup with multiple SDK fallbacks #### **Documentation** - **Updated** README to reflect new modular architecture - **Documented** all installed packages and post-installation tasks - **Added** clear instructions for supported distributions - **Archived** legacy script in `.archive/` folder ### 🎯 Benefits - **Maintainability**: Each script has a single, clear responsibility - **Debugging**: Easier to isolate and fix issues in specific components - **Flexibility**: Can run individual scripts for specific setup needs - **Reliability**: Better error handling and package detection - **Documentation**: Clear understanding of what gets installed and configured ### 🧪 Testing - [x] Tested on fresh Fedora installation - [x] Verified package installation checks work correctly - [x] Confirmed dotfile symlinking functions properly - [x] Validated Fedora .NET setup with dynamic version detection ### 📁 Files Changed ``` ├── main-setup.sh (new) ├── scripts/ │ ├── 00-system-prep.sh (new) │ ├── 01-package-install.sh (new) │ ├── 02-dev-tools-setup.sh (new) │ ├── 03-fedora-dotnet-setup.sh (new) │ └── 04-config-symlinks.sh (new) ├── .archive/ │ └── post_install.sh (moved) └── README.md (updated) ``` ### 🔧 Usage **Before:** ```bash ./post_install.sh ``` **After:** ```bash ./main-setup.sh ``` Individual components can also be run separately: ```bash bash scripts/01-package-install.sh bash scripts/02-dev-tools-setup.sh ``` ### 🚀 Future Improvements - [ ] Add support for additional Linux distributions - [ ] Create configuration file for customizing package lists - [ ] Add dry-run mode to preview changes - [ ] Implement logging for better troubleshooting ### ✅ Checklist - [x] Code follows project conventions - [x] Documentation updated - [x] Legacy code properly archived - [x] Error handling implemented - [x] Testing completed on target platform --- **Breaking Changes:** None - the main entry point behavior remains the same, just with improved reliability and maintainability. **Migration:** Users can continue using the same workflow, but now have the option to run individual setup components as needed.
import_user_blakeridgway_4Umu (Migrated from gitlab.com) closed this pull request 2025-05-24 04:06:01 +00:00
import_user_blakeridgway_4Umu (Migrated from gitlab.com) merged commit into master 2025-05-24 04:06:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: blakeridgway/dotfiles#3
No description provided.