dotfiles/scripts/00-system-prep.sh
Blake Ridgway 61004e0967 refactor: modularize post-install setup script
Break down monolithic script into focused components:
- 00-system-prep.sh: system updates and Flathub
- 01-package-install.sh: system packages and Flatpaks
- 02-dev-tools-setup.sh: Neovim, fonts, shell tools
- 03-fedora-dotnet-setup.sh: .NET development environment
- 04-config-symlinks.sh: dotfile symlinking

Fixes:
- Use rpm -q for accurate package checks
- Dynamic Fedora version detection
- Replace neofetch with fastfetch
- Correct dotfile names (aliases.zsh, commit-conventions.txt)
2025-05-23 22:54:14 -05:00

34 lines
1 KiB
Bash
Executable file

#!/bin/bash
# 00-system-prep.sh
# Updates system and sets up Flathub.
# Relies on DISTRO and PACKAGE_MANAGER being set by the caller.
echo "--- Starting System Preparation ---"
if [ -z "$DISTRO" ] || [ -z "$PACKAGE_MANAGER" ]; then
echo "ERROR: DISTRO and PACKAGE_MANAGER must be set in the environment."
exit 1
fi
# Update system before installing packages
echo "Updating system packages..."
if [ "$PACKAGE_MANAGER" == "dnf" ]; then
sudo dnf update -y && sudo dnf upgrade -y
elif [ "$PACKAGE_MANAGER" == "apt" ]; then
sudo apt update && sudo apt upgrade -y
else
echo "WARNING: Unknown package manager '$PACKAGE_MANAGER'. Skipping system update."
fi
# Setup Flatpak
echo "Setting up Flathub repository..."
if command -v flatpak &> /dev/null; then
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
else
echo "WARNING: flatpak command not found. Skipping Flathub setup."
echo "Ensure Flatpak is installed via 01-package-install.sh or manually."
fi
echo "--- System Preparation Finished ---"