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)
This commit is contained in:
parent
a1c28c4225
commit
61004e0967
6 changed files with 674 additions and 0 deletions
34
scripts/00-system-prep.sh
Executable file
34
scripts/00-system-prep.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/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 ---"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue