Compare commits

...
Sign in to create a new pull request.

16 commits

Author SHA1 Message Date
Blake Ridgway
a858dd8309 fix: changed gitconfig to look at ~/ instead of hardcoded path 2025-07-12 16:04:15 -05:00
Blake Ridgway
96ac5f4de3 feat: Added Signal and Discord flatpaks 2025-06-11 20:28:33 -05:00
Blake Ridgway
f2fc37b7dc
Merge pull request #3 from blakeridgway/poc/install-rewrite
Modularize Post-Install Setup System
2025-05-23 23:06:00 -05:00
Blake Ridgway
b1b7d61769 docs: update README and refactor IDE package installation
- Update README to reflect new modular setup architecture
- Document all installed packages, scripts, and post-install tasks
- Add clear instructions for supported distributions and customization

- Move Visual Studio Code installation to main package script
- Add JetBrains Rider to package installation
- Remove redundant VS Code install from Fedora .NET script
- Consolidate IDE installations in single location for better organization
2025-05-23 23:02:34 -05:00
Blake Ridgway
71ad3511e4 chore: archive old post_install.sh script
Moved legacy monolithic script to .archive/ before implementing
modular setup system.
2025-05-23 22:56:38 -05:00
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
Blake Ridgway
a1c28c4225
Create temp_dotnet_checklist.md 2025-05-22 16:06:12 -05:00
Blake Ridgway
251194b35c Added nvim to zshrc 2024-09-13 13:27:40 -05:00
Blake Ridgway
11817d7226 (feat): Added nvim to the install 2024-09-13 13:27:23 -05:00
Blake Ridgway
e34d5719ea (feat): Changed micro to nvim 2024-09-13 13:27:01 -05:00
Blake Ridgway
a1312295bc (chore): removed nushell references 2024-08-30 19:28:18 -05:00
Blake Ridgway
c4bd753289 (feat): Added/Remove apps, cleaned up script 2024-08-30 19:27:16 -05:00
Blake Ridgway
e3b38c2d02 (feat): Added/Remove apps, cleaned up script 2024-08-30 19:27:11 -05:00
Blake Ridgway
5659361bab (feat): Added auto selection of distro 2024-08-30 19:15:11 -05:00
Blake Ridgway
1a2ab0d220 updated back to Fedora 2024-08-12 13:19:24 -05:00
Blake Ridgway
5271e4b15c Merge pull request 'NuShell + Steam Speed Fix' (#3) from refresh_somethings into master
Reviewed-on: http://149.76.112.184:3000/blake/dotfiles/pulls/3
2024-04-26 14:13:06 -05:00
13 changed files with 1073 additions and 192 deletions

173
.archive/post_install.sh Executable file
View file

@ -0,0 +1,173 @@
#!/bin/bash
# A script for setting up post install
# Relies on Flatpak to be installed
# Created by Blake Ridgway
# Function to detect the Linux distribution
detect_linux_distro() {
if [ -f /etc/os-release ]; then
. /etc/os-release
echo "$ID"
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
echo "$DISTRIBUTOR_ID"
elif [ -f /etc/debian_version ]; then
echo "debian"
elif [ -f /etc/redhat-release ]; then
echo "redhat"
else
echo "unknown"
fi
}
# Detect the Linux distribution
DISTRO=$(detect_linux_distro)
# Determine the appropriate package manager
case "$DISTRO" in
fedora|rhel|centos)
PACKAGE_MANAGER="dnf"
;;
debian|ubuntu|pop)
PACKAGE_MANAGER="apt"
;;
*)
echo "Unsupported distribution: $DISTRO"
exit 1
;;
esac
# Update system before installing packages
if [ "$PACKAGE_MANAGER" == "dnf" ]; then
sudo dnf update && sudo dnf upgrade
elif [ "$PACKAGE_MANAGER" == "apt" ]; then
sudo apt update && sudo apt upgrade -y
fi
# Setup Flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
PACKAGE_LIST=(
btop
curl
git
gh
fd-find
flatpak
libfontconfig-dev
libssl-dev
neofetch
python3
python3-pip
ripgrep
virt-manager
zsh
)
FLATPAK_LIST=(
com.bitwarden.desktop
com.github.tchx84.Flatseal
com.valvesoftware.Steam
net.davidotek.pupgui2
net.veloren.airshipper
org.videolan.VLC
)
echo #######################
echo # Installing Packages #
echo #######################
for package_name in ${PACKAGE_LIST[@]}; do
if [ "$PACKAGE_MANAGER" == "dnf" ]; then
if ! dnf list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo dnf install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
elif [ "$PACKAGE_MANAGER" == "apt" ]; then
if ! dpkg -l | grep -q "^\<ii\> $package_name"; then
echo "Installing $package_name..."
sleep .5
sudo apt install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
fi
done
for flatpak_name in ${FLATPAK_LIST[@]}; do
if ! flatpak list | grep -q $flatpak_name; then
flatpak install "$flatpak_name" -y
else
echo "$flatpak_name already installed"
fi
done
echo ###################
echo # Setting up NVIM #
echo ###################
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux64.tar.gz
echo ##########
echo # pynvim #
echo ##########
/usr/bin/python3 -m pip install pynvim
echo #####################
echo # Install Nerd Font #
echo #####################
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hack.zip && unzip Hack.zip -d Hack
mkdir -p ~/.local/share/fonts && cp Hack/HackNerdFont-Regular.ttf ~/.local/share/fonts
fc-cache -f -v
rm -rf Hack*
echo ######################
echo # Installing OhMyZSH #
echo ######################
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo ###################
echo # Install Rust Up #
echo ###################
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
echo ##################
echo # Setup Starship #
echo ##################
curl -sS https://starship.rs/install.sh | sh
echo ###############
echo # Config File #
echo ###############
cp terminal/starship.toml ~/.config/starship.toml
# Symlink files
FILES=('vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' 'aliases')
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
ln -sf "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]; then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink.'
exit 1
fi
done

124
README.md
View file

@ -1,19 +1,123 @@
# Fresh Install
This is a collection of items I use when I setup a fresh install.
This is a collection of scripts and dotfiles I use when setting up a fresh Linux installation.
## Install
## Quick Start
./post_install will run a script that installs the software that I use on daily basis, and if you have all the necessary programs installed. If you don't, it installs them for you! Once the dependencies are installed, it will run any third party installations, and create symlinks for the necessary config files in the correct locations.
Run the main setup script to install software, configure development tools, and symlink dotfiles:
### Dotfiles
```bash
./main-setup.sh
```
Here's my collection of dotfiles I use on Linux environments. I continuously add to this repo over time, as I customise my dev environment. Feel free to fork this and modify the scripts/dotfiles to suit your own needs!
The script will automatically detect your Linux distribution (Fedora, Ubuntu, Debian, etc.) and use the appropriate package manager.
Git Make sure to edit the gitconfig and add your credentials instead of mine
## What Gets Installed
VIM Installation Tips I use neovim and vim-plug. So if you're using regular vim you might want to remove the neovim specific plugins from my vimrc. Also, you might need to run :PlugClean to remove the plugin directories then run :PlugInstall to reinstall them.
### Core Packages
- Development tools: `git`, `gh`, `curl`, `wget`, `ripgrep`, `fd-find`
- System utilities: `btop`, `fastfetch`, `zsh`, `flatpak`
- Virtualization: `virt-manager`
- Python: `python3`, `python3-pip`
### Development Environment
- **Neovim** (latest version from GitHub)
- **Hack Nerd Font** for terminal
- **Oh My Zsh** shell framework
- **Starship** prompt
- **Rust** toolchain via rustup
### Fedora-Specific (.NET Development)
On Fedora systems, additional packages are installed:
- **Visual Studio Code**
- **.NET SDK** (with Microsoft repository)
- **PostgreSQL** server and tools
- **Docker** (moby-engine) with Docker Compose
### Flatpak Applications
- Bitwarden
- Flatseal
- Steam
- ProtonUp-Qt
- Rider
- Veloren Airshipper
- Visual Studio Code
- VLC Media Player
## Modular Architecture
The setup is broken down into 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` - Dotfile symlinking
You can run individual scripts if you only need specific components.
## Dotfiles
The following configuration files will be symlinked to your home directory:
- `.vimrc` & `.vim/` - Vim/Neovim configuration
- `.zshrc` & `.zsh/` - Zsh shell configuration
- `.gitconfig` - Git configuration (**edit with your credentials**)
- `.gitignore` - Global Git ignore patterns
- `.agignore` - Silver Searcher ignore patterns
- `.aliases` - Shell aliases (from `aliases.zsh`)
- `.gitmessage` - Git commit template (from `commit-conventions.txt`)
### Git Configuration
**Important:** Edit `gitconfig` and replace my credentials with yours before running the setup.
### Vim/Neovim Setup
I use Neovim with vim-plug for plugin management. If you're using regular Vim, you may need to:
1. Remove Neovim-specific plugins from `.vimrc`
2. Run `:PlugClean` to remove plugin directories
3. Run `:PlugInstall` to reinstall compatible plugins
## Post-Installation Tasks
After running the setup, remember to:
1. **Configure Git with your details:**
```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
2. **Generate SSH key:**
```bash
ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)
```
3. **Install Powerlevel10k gitstatus (if using):**
```bash
~/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/install -f
```
4. **Log out and back in** for Docker group changes to take effect (Fedora)
5. **Install VS Code extensions** (Fedora):
- C# Dev Kit
- GitLens
- Prettier
- NuGet Package Manager GUI
## Supported Distributions
- **Fedora** (with full .NET development environment)
- **Ubuntu/Debian** (core packages and development tools)
- **Pop!_OS** (core packages and development tools)
## Customization
Feel free to fork this repository and modify the scripts/dotfiles to suit your needs. The modular structure makes it easy to add, remove, or modify specific components.
## Legacy
The original monolithic `post_install.sh` script has been archived in `.archive/` for reference.
*Things to Remember*
`~/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/install -f`
`ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)`

View file

@ -57,8 +57,8 @@ alias tmuxreload='source ~/.tmux.conf'
alias zshreload='source ~/.zshrc'
# nvim
alias vim=micro
alias vi=micro
alias vim=nvim
alias vi=nvim
# Configuration
alias vimrc='nvim ~/.vimrc'

View file

@ -2,7 +2,7 @@
email = blake@blakeridgway.dev
name = Blake Ridgway
[commit]
template = /home/blake/dotfiles/commit-conventions.txt
template = ~/dotfiles/commit-conventions.txt
[core]
editor = nvim +14 -c +startinsert
[init]

110
main-setup.sh Executable file
View file

@ -0,0 +1,110 @@
#!/bin/bash
# Main setup script
# Calls other scripts to perform post-installation tasks.
# --- Global Variables & Helper Functions ---
# SCRIPT_ROOT_DIR will be the directory where main-setup.sh is located
export SCRIPT_ROOT_DIR
SCRIPT_ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
export SCRIPTS_DIR="${SCRIPT_ROOT_DIR}/scripts"
# Function to detect the Linux distribution
detect_linux_distro() {
if [ -f /etc/os-release ]; then
# shellcheck disable=SC1091
. /etc/os-release
echo "$ID"
elif [ -f /etc/lsb-release ]; then
# shellcheck disable=SC1091
. /etc/lsb-release
echo "$DISTRIBUTOR_ID"
elif [ -f /etc/debian_version ]; then
echo "debian"
elif [ -f /etc/redhat-release ]; then
if grep -qi "fedora" /etc/redhat-release; then
echo "fedora"
elif grep -qi "centos" /etc/redhat-release; then
echo "centos"
elif grep -qi "red hat enterprise linux" /etc/redhat-release; then
echo "rhel"
else
echo "redhat"
fi
else
echo "unknown"
fi
}
# Detect the Linux distribution and set package manager
export DISTRO
DISTRO=$(detect_linux_distro)
export PACKAGE_MANAGER
case "$DISTRO" in
fedora|rhel|centos)
PACKAGE_MANAGER="dnf"
;;
debian|ubuntu|pop)
PACKAGE_MANAGER="apt"
;;
*)
echo "Unsupported distribution: $DISTRO"
exit 1
;;
esac
echo "Detected Distribution: $DISTRO"
echo "Using Package Manager: $PACKAGE_MANAGER"
echo "Script Root Directory: $SCRIPT_ROOT_DIR"
echo "--------------------------------------------------"
# --- Execute Setup Scripts ---
echo "Executing 00-system-prep.sh..."
if ! bash "${SCRIPTS_DIR}/00-system-prep.sh"; then
echo "ERROR: 00-system-prep.sh failed."
exit 1
fi
echo "--------------------------------------------------"
echo "Executing 01-package-install.sh..."
if ! bash "${SCRIPTS_DIR}/01-package-install.sh"; then
echo "ERROR: 01-package-install.sh failed."
exit 1
fi
echo "--------------------------------------------------"
echo "Executing 02-dev-tools-setup.sh..."
if ! bash "${SCRIPTS_DIR}/02-dev-tools-setup.sh"; then
echo "ERROR: 02-dev-tools-setup.sh failed."
exit 1
fi
echo "--------------------------------------------------"
if [ "$DISTRO" == "fedora" ]; then
echo "Executing 03-fedora-dotnet-setup.sh..."
if ! bash "${SCRIPTS_DIR}/03-fedora-dotnet-setup.sh"; then
echo "ERROR: 03-fedora-dotnet-setup.sh failed."
# Decide if this is a fatal error for the whole script
# exit 1
fi
echo "--------------------------------------------------"
fi
echo "Executing 04-config-symlinks.sh..."
if ! bash "${SCRIPTS_DIR}/04-config-symlinks.sh"; then
echo "ERROR: 04-config-symlinks.sh failed."
# exit 1
fi
echo "--------------------------------------------------"
echo ""
echo "#####################################"
echo # Main setup script finished! #
echo #####################################"
echo "Please review the output for any manual steps or errors."
echo "You may need to restart your terminal or log out/log in for all changes to take effect."
exit 0

View file

@ -1,179 +0,0 @@
#!/bin/bash
# A script for setting up post install
# Relies on Flatpak to be installed
# Created by Blake Ridgway
# Update system before installing packages
sudo apt update && sudo apt upgrade
PACKAGE_LIST=(
bpytop
curl
git
golang
fd-find
flatpak
libfontconfig-dev
libssl-dev:
micro
neofetch
python3
python3-pip
ripgrep
steam
virt-manager
)
FLATPAK_LIST=(
com.bitwarden.desktop
net.davidotek.pupgui2
)
echo #######################
echo # Installing Packages #
echo #######################
for package_name in ${PACKAGE_LIST[@]}; do
if ! apt list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo apt install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
done
for flatpak_name in ${FLATPAK_LIST[@]}; do
if ! flatpak list | grep -q $flatpak_name; then
flatpak install "$flatpak_name" -y
else
echo "$package_name already installed"
fi
done
echo #######
echo # SSH #
echo #######
ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)
echo ##########
echo # pynvim #
echo ##########
/usr/bin/python3 -m pip install pynvim
echo #####################
echo # Install Nerd Font #
echo #####################
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hack.zip && unzip Hack.zip -d Hack
mkdir -p ~/.local/share/fonts && cp Hack/HackNerdFont-Regular.ttf ~/.local/share/fonts
fc-cache -f -v
rm -rf Hack*
echo ###################
echo # Install Rust Up #
echo ###################
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
echo #####################
echo # Enable Cargo/Rust #
echo #####################
. "$HOME/.cargo/env"
echo ######################
echo # Install Cargo Apps #
echo ######################
CARGO_LIST=(
nu
alacritty
)
for cargo_name in ${CARGO_LIST[@]}; do
cargo install "$cargo_name"
done
echo ##################
echo # Setup Starship #
echo ##################
curl -sS https://starship.rs/install.sh | sh
echo ###############
echo # Config File #
echo ###############
cp terminal/starship.toml ~/.config/starship.toml
echo ###################
echo # Setting up nvim #
echo ###################
cp -r terminal/nushell/ ~/.config/
echo ######################
echo # Fix Steam Download #
echo ######################
cp steam/steam_dev.cfg ~/.steam/steam/steam_dev.cfg
echo #######################
echo # Cleanup and Updates #
echo #######################
sudo apt upgrade
flatpak update
# Symlink files
FILES=('vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' 'aliases')
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
ln -sf "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]; then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink.'
exit 1
fi
done
####################################################
# Soon to be removed from this post install script #
####################################################
# Check to see if running as sudo/root
#if [ "$(id -u)" -ne 0 ]; then
# echo 'This script must be run by root' >&2
# exit 1
#fi
#echo ######################
#echo # Installing OhMyZSH #
#echo ######################
#sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#cargo
#kitty
#neovim
#plasma-discover-backend-flatpak
#ruby
#solaar
#tilix
#zsh
#net.veloren.airshipper
# Verify flatpak is engaged properly
#flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

34
scripts/00-system-prep.sh Executable file
View 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 ---"

126
scripts/01-package-install.sh Executable file
View file

@ -0,0 +1,126 @@
#!/bin/bash
# 01-package-install.sh
# Installs system packages and Flatpak applications.
# Relies on DISTRO and PACKAGE_MANAGER being set by the caller.
echo "--- Starting Package Installation ---"
if [ -z "$DISTRO" ] || [ -z "$PACKAGE_MANAGER" ]; then
echo "ERROR: DISTRO and PACKAGE_MANAGER must be set in the environment."
exit 1
fi
# Define base package list
BASE_PACKAGE_LIST=(
btop
curl
git
gh
fd-find
flatpak
python3
python3-pip
ripgrep
virt-manager
zsh
wget
unzip
)
# Distro-specific packages to add to the main list
DISTRO_SPECIFIC_PACKAGES=()
if [ "$PACKAGE_MANAGER" == "dnf" ]; then
DISTRO_SPECIFIC_PACKAGES+=(
"fontconfig-devel" # for fc-cache
"openssl-devel" # for various compilations
"util-linux-user" # for chsh, if needed by OhMyZsh script
)
elif [ "$PACKAGE_MANAGER" == "apt" ]; then
DISTRO_SPECIFIC_PACKAGES+=(
"libfontconfig-dev"
"libssl-dev"
"fd-find" # On Debian/Ubuntu, binary is fdfind, symlink to fd often needed
# Or user might prefer 'fd' package if available from other sources
)
fi
# Combine package lists
PACKAGE_LIST=("${BASE_PACKAGE_LIST[@]}" "${DISTRO_SPECIFIC_PACKAGES[@]}")
PACKAGE_LIST=($(printf "%s\n" "${PACKAGE_LIST[@]}" | LC_ALL=C sort -u))
FLATPAK_LIST=(
com.bitwarden.desktop
com.discordapp.Discord
com.github.tchx84.Flatseal
com.jetbrains.Rider
com.valvesoftware.Steam
com.visualstudio.code
net.davidotek.pupgui2
net.veloren.airshipper
org.signal.Signal
org.videolan.VLC
)
echo "Installing System Packages..."
for package_name in "${PACKAGE_LIST[@]}"; do
if [ "$PACKAGE_MANAGER" == "dnf" ]; then
if ! rpm -q "$package_name" &>/dev/null; then
echo "Installing $package_name (dnf)..."
if sudo dnf install "$package_name" -y; then
echo "$package_name has been installed."
else
echo "WARNING: Failed to install $package_name. It may not be available in the repositories."
fi
else
echo "$package_name already installed."
fi
elif [ "$PACKAGE_MANAGER" == "apt" ]; then
# For apt, check if package provides the command or is installed
# dpkg-query is generally more reliable for checking installed status
actual_package_name=$package_name
if [ "$package_name" == "fd-find" ] && ! dpkg -s fd-find &>/dev/null ; then
# On some newer Ubuntu/Debian, 'fd-find' might be the package,
# but user might want 'fd' if it's a different source or a metapackage.
# For now, we stick to fd-find.
: # Keep actual_package_name as fd-find
fi
if ! dpkg-query -W -f='${Status}' "$actual_package_name" 2>/dev/null | grep -q "ok installed"; then
echo "Installing $actual_package_name (apt)..."
sudo apt install "$actual_package_name" -y
echo "$actual_package_name has been installed."
else
echo "$actual_package_name already installed."
fi
fi
done
# Post-install for fd-find on Debian/Ubuntu (create symlink)
if [ "$PACKAGE_MANAGER" == "apt" ] && command -v fdfind &>/dev/null && ! command -v fd &>/dev/null; then
if dpkg-query -W -f='${Status}' "fd-find" 2>/dev/null | grep -q "ok installed"; then
echo "Creating symlink for fd from fdfind..."
sudo ln -sf /usr/bin/fdfind /usr/local/bin/fd # or ~/.local/bin/fd if preferred
fi # Ensure this line is just 'fi' (and optional comment)
fi
echo "Installing Flatpak Applications..."
if command -v flatpak &> /dev/null; then
for flatpak_name in "${FLATPAK_LIST[@]}"; do
if ! flatpak list --app | grep -q "$flatpak_name"; then
echo "Installing Flatpak $flatpak_name..."
flatpak install flathub "$flatpak_name" -y
echo "$flatpak_name has been installed."
else
echo "Flatpak $flatpak_name already installed."
fi
done
else
echo "WARNING: flatpak command not found. Skipping Flatpak app installation."
fi
echo "--- Package Installation Finished ---"

108
scripts/02-dev-tools-setup.sh Executable file
View file

@ -0,0 +1,108 @@
#!/bin/bash
# 02-dev-tools-setup.sh
# Installs various development tools and utilities.
echo "--- Starting Development Tools Setup ---"
# Setup NVIM
echo "Setting up Neovim..."
if command -v nvim &>/dev/null && [[ "$(nvim --version | head -n 1)" == "NVIM"* ]]; then
echo "Neovim appears to be installed. Checking version/source or skipping."
# Add logic here if you want to ensure it's your /opt/nvim version
else
echo "Downloading and installing Neovim to /opt/nvim..."
TEMP_NVIM_DIR=$(mktemp -d)
curl -Lo "${TEMP_NVIM_DIR}/nvim-linux64.tar.gz" https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf "${TEMP_NVIM_DIR}/nvim-linux64.tar.gz"
rm -rf "${TEMP_NVIM_DIR}" # Clean up
echo "Neovim installed to /opt/nvim. Add /opt/nvim-linux64/bin to your PATH."
# Consider adding to PATH via a profile script if not handled by zshrc/bashrc symlinks
if [ ! -f /usr/local/bin/nvim ] && [ -d /opt/nvim-linux64/bin ]; then
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/nvim
echo "Symlinked nvim to /usr/local/bin/nvim"
fi
fi
# pynvim
echo "Installing pynvim for Neovim Python support..."
if /usr/bin/python3 -m pip show pynvim &>/dev/null; then
echo "pynvim already installed."
else
/usr/bin/python3 -m pip install --user pynvim
echo "pynvim installed for the current user."
fi
# Install Nerd Font (Hack)
echo "Installing Hack Nerd Font..."
NERDFONT_VERSION="v3.2.1" # Or use "latest" if API allows, else check manually
NERDFONT_NAME="Hack"
FONT_DIR="$HOME/.local/share/fonts"
mkdir -p "$FONT_DIR"
# Check if a Hack Nerd Font is already installed to avoid re-downloading
if fc-list | grep -qi "Hack Nerd Font"; then
echo "Hack Nerd Font already installed."
else
echo "Downloading and installing Hack Nerd Font..."
TEMP_FONT_DIR=$(mktemp -d)
wget -qO "${TEMP_FONT_DIR}/${NERDFONT_NAME}.zip" "https://github.com/ryanoasis/nerd-fonts/releases/download/${NERDFONT_VERSION}/${NERDFONT_NAME}.zip"
if [ $? -eq 0 ]; then
unzip -q "${TEMP_FONT_DIR}/${NERDFONT_NAME}.zip" -d "${TEMP_FONT_DIR}/${NERDFONT_NAME}NerdFont"
# Copy only .ttf or .otf files
find "${TEMP_FONT_DIR}/${NERDFONT_NAME}NerdFont" \( -name "*.ttf" -o -name "*.otf" \) -exec cp {} "$FONT_DIR/" \;
echo "Updating font cache..."
fc-cache -f -v
echo "Hack Nerd Font installed."
else
echo "ERROR: Failed to download Hack Nerd Font."
fi
rm -rf "${TEMP_FONT_DIR}" # Clean up
fi
# Installing OhMyZSH
echo "Installing OhMyZSH..."
if [ -d "$HOME/.oh-my-zsh" ]; then
echo "OhMyZSH already installed."
else
echo "Attempting to install OhMyZSH. It might prompt to change your default shell."
# CHSH=no RUNZSH=no prevents the script from trying to change shell and exit
# The --unattended flag attempts a non-interactive install
if sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended; then
echo "OhMyZSH installation script finished."
echo "If ZSH is not your default shell, change it manually: chsh -s \$(which zsh)"
echo "Then, start a new ZSH session."
else
echo "ERROR: OhMyZSH installation failed."
fi
fi
# Install Rust Up
echo "Installing Rust via rustup..."
if command -v rustc &>/dev/null; then
echo "Rust (rustc) already installed."
else
# The -y flag automates the installation, --no-modify-path prevents it from altering .profile/.bashrc directly
# You'll need to source "$HOME/.cargo/env" or add it to your shell's config manually
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
echo "Rust installed via rustup. Source \"\$HOME/.cargo/env\" or add it to your shell config."
echo "For the current session, you can run: source \"\$HOME/.cargo/env\""
fi
# Setup Starship
echo "Installing Starship prompt..."
if command -v starship &>/dev/null; then
echo "Starship already installed."
else
# The -y flag attempts a non-interactive install
if curl -sS https://starship.rs/install.sh | sh -s -- -y; then
echo "Starship installed. Add 'eval \"\$(starship init zsh)\"' (or bash/fish) to your shell config."
else
echo "ERROR: Starship installation failed."
fi
fi
echo "--- Development Tools Setup Finished ---"

248
scripts/03-fedora-dotnet-setup.sh Executable file
View file

@ -0,0 +1,248 @@
#!/bin/bash
# 03-fedora-dotnet-setup.sh
# Sets up .NET Development Environment specifically for Fedora.
# Assumes it's being run on Fedora and dnf is available.
echo "--- Starting Fedora .NET Development Environment Setup ---"
# Detect current Fedora version
CURRENT_FEDORA_VERSION=$(rpm -E %fedora)
echo "Detected Fedora version: $CURRENT_FEDORA_VERSION"
echo ""
echo "############################################################"
echo "# Fedora Specific: .NET Development Environment Setup #"
echo "# #"
echo "# Using Fedora version: $CURRENT_FEDORA_VERSION #"
echo "# If this is a future/unsupported version, some packages #"
echo "# or repositories might not be available yet. #"
echo "############################################################"
echo ""
FEDORA_DOTNET_PACKAGES=(
"postgresql-server"
"postgresql-contrib"
"moby-engine" # Docker Engine on Fedora
"docker-compose" # Note: might be 'podman-compose' on newer Fedora
)
echo "Installing Fedora-specific packages for .NET development..."
for pkg_name in "${FEDORA_DOTNET_PACKAGES[@]}"; do
if ! rpm -q "$pkg_name" &>/dev/null; then
echo "Installing $pkg_name..."
if sudo dnf install -y "$pkg_name"; then
echo "$pkg_name has been installed."
else
echo "WARNING: Failed to install $pkg_name. It may not be available in the repositories."
# Special handling for docker-compose
if [ "$pkg_name" == "docker-compose" ]; then
echo "Trying alternative: podman-compose..."
if sudo dnf install -y podman-compose; then
echo "podman-compose installed as alternative to docker-compose."
else
echo "Neither docker-compose nor podman-compose could be installed."
fi
fi
fi
else
echo "$pkg_name is already installed."
fi
done
echo ""
echo "--------------------------------------------------"
echo "I. Core .NET Development Environment"
echo "--------------------------------------------------"
echo "Registering Microsoft Package Repository..."
MS_REPO_URL_BASE="https://packages.microsoft.com/config/fedora"
FEDORA_VERSION_FOR_MS_REPO="$CURRENT_FEDORA_VERSION"
MS_REPO_RPM_URL="${MS_REPO_URL_BASE}/${FEDORA_VERSION_FOR_MS_REPO}/packages-microsoft-prod.rpm"
MS_GPG_KEY_URL="https://packages.microsoft.com/keys/microsoft.asc"
TEMP_MS_RPM_DIR=$(mktemp -d)
TEMP_MS_RPM_PATH="${TEMP_MS_RPM_DIR}/packages-microsoft-prod-temp.rpm"
if ! sudo dnf repolist enabled | grep -q "packages-microsoft-com-prod"; then
echo "Importing Microsoft GPG key: $MS_GPG_KEY_URL"
if sudo rpm --import "$MS_GPG_KEY_URL"; then
echo "Microsoft GPG key imported successfully."
else
echo "WARNING: Failed to import Microsoft GPG key."
fi
echo "Downloading Microsoft package repository for Fedora $FEDORA_VERSION_FOR_MS_REPO: $MS_REPO_RPM_URL"
if wget --quiet "$MS_REPO_RPM_URL" -O "$TEMP_MS_RPM_PATH"; then
echo "Installing downloaded repository configuration..."
if sudo dnf install -y "$TEMP_MS_RPM_PATH"; then
echo "Microsoft repository RPM installed."
else
echo "ERROR: Failed to install Microsoft repository RPM."
fi
else
echo "ERROR: Failed to download Microsoft repository RPM from $MS_REPO_RPM_URL."
echo "This might be because Microsoft doesn't yet support Fedora $FEDORA_VERSION_FOR_MS_REPO."
echo "You can try using a previous Fedora version number or install .NET manually."
# Fallback: try with previous Fedora version
FALLBACK_VERSION=$((CURRENT_FEDORA_VERSION - 1))
echo "Trying fallback with Fedora $FALLBACK_VERSION..."
FALLBACK_URL="${MS_REPO_URL_BASE}/${FALLBACK_VERSION}/packages-microsoft-prod.rpm"
if wget --quiet "$FALLBACK_URL" -O "$TEMP_MS_RPM_PATH"; then
echo "Fallback download successful. Installing..."
sudo dnf install -y "$TEMP_MS_RPM_PATH"
else
echo "Fallback also failed. Skipping Microsoft repository setup."
fi
fi
sudo rm -rf "$TEMP_MS_RPM_DIR" # Clean up
else
echo "Microsoft package repository already configured."
fi
echo "Installing .NET SDK..."
# Try different .NET SDK package names
DOTNET_SDK_PACKAGES=("dotnet-sdk-8.0" "dotnet-sdk-9.0" "dotnet")
DOTNET_INSTALLED=false
for sdk_package in "${DOTNET_SDK_PACKAGES[@]}"; do
if rpm -q "$sdk_package" &>/dev/null; then
echo ".NET SDK ($sdk_package) already installed."
DOTNET_INSTALLED=true
break
fi
done
if [ "$DOTNET_INSTALLED" = false ]; then
for sdk_package in "${DOTNET_SDK_PACKAGES[@]}"; do
echo "Attempting to install $sdk_package..."
if sudo dnf install -y "$sdk_package"; then
echo ".NET SDK ($sdk_package) installed successfully."
DOTNET_INSTALLED=true
break
else
echo "Failed to install $sdk_package, trying next option..."
fi
done
if [ "$DOTNET_INSTALLED" = false ]; then
echo "ERROR: Failed to install any .NET SDK package."
echo "You may need to install .NET manually from https://dotnet.microsoft.com/"
fi
fi
echo "To verify .NET Installation, run these commands manually:"
echo " dotnet --version"
echo " dotnet --list-sdks"
echo " dotnet --list-runtimes"
echo ""
echo "--------------------------------------------------"
echo "II. Code Editor/IDE (Visual Studio Code)"
echo "--------------------------------------------------"
echo "Visual Studio Code (package 'code') should have been installed."
echo "Open VS Code and install these essential extensions from the Extensions view (Ctrl+Shift+X):"
echo " - C# Dev Kit (Publisher: Microsoft)"
echo " - (Optional but Recommended) NuGet Package Manager GUI"
echo " - (Optional but Recommended) GitLens"
echo " - (Optional but Recommended) Prettier - Code formatter"
echo " - (Optional) Any Blazor-specific snippet or tooling extensions"
echo "Restart VS Code if prompted after extension installations."
echo ""
echo "--------------------------------------------------"
echo "III. Version Control (Git)"
echo "--------------------------------------------------"
echo "Git (package 'git') should have been installed by 01-package-install.sh."
echo "Configure Git with your details by running these commands:"
echo " git config --global user.name \"Your Name\""
echo " git config --global user.email \"youremail@example.com\""
echo ""
echo "--------------------------------------------------"
echo "IV. Web Browser for Frontend Testing"
echo "--------------------------------------------------"
echo "Ensure you have a modern web browser (e.g., Firefox, usually pre-installed on Fedora)."
echo "If needed, you can install Chromium with: sudo dnf install -y chromium"
echo "Familiarize yourself with its Developer Tools (Inspector, Console, Network)."
echo ""
echo "--------------------------------------------------"
echo "V. Database (Optional - PostgreSQL Example)"
echo "--------------------------------------------------"
echo "PostgreSQL server and contrib packages should have been installed."
if command -v postgresql-setup &>/dev/null; then
echo "Initializing PostgreSQL Database Cluster (if not already done)..."
# Fixed the postgresql-setup command
if sudo postgresql-setup --initdb; then
echo "PostgreSQL database cluster initialized."
else
echo "PostgreSQL initialization failed or was already done."
fi
else
echo "WARNING: postgresql-setup command not found. Manual initialization might be needed."
fi
echo "Enabling and Starting PostgreSQL Service..."
if sudo systemctl enable --now postgresql; then
echo "PostgreSQL service enabled and started."
else
echo "WARNING: Failed to enable/start PostgreSQL service."
fi
echo "To create a PostgreSQL User and Database, run the following commands:"
echo " 1. Access psql: sudo -u postgres psql"
echo " 2. Inside psql, execute (replace placeholders):"
echo " CREATE USER myappuser WITH PASSWORD 'yoursecurepassword';"
echo " CREATE DATABASE myappdb OWNER myappuser;"
echo " 3. Exit psql: \\q"
echo "(Optional) Install a PostgreSQL GUI Tool like pgAdmin 4:"
echo " sudo dnf install -y pgadmin4"
echo "Or DBeaver (download from their website or check Fedora repos/Flathub)."
echo ""
echo "--------------------------------------------------"
echo "VI. Containerization (Optional but Recommended - Docker)"
echo "--------------------------------------------------"
echo "Docker Engine (moby-engine) and Docker Compose should have been installed."
echo "Enabling and Starting Docker Service..."
if sudo systemctl enable --now docker; then
echo "Docker service enabled and started."
else
echo "WARNING: Failed to enable/start Docker service."
fi
echo "Adding current user ($USER) to the Docker group..."
if sudo usermod -aG docker "$USER"; then
echo "User added to docker group successfully."
else
echo "WARNING: Failed to add user to docker group."
fi
echo "IMPORTANT: You MUST log out and log back in for this group change to take effect."
echo "After logging back in, verify Docker Installation by running:"
echo " docker --version"
echo " docker-compose --version (or podman-compose --version)"
echo " docker run hello-world"
echo ""
echo "--------------------------------------------------"
echo "VII. Final Checks for .NET Setup"
echo "--------------------------------------------------"
echo "Consider rebooting your system to ensure all services and paths are correctly initialized: sudo reboot"
echo "After setup (and potential relogin for Docker), create a Test .NET Project:"
echo " mkdir -p ~/dotnet_test_projects && cd ~/dotnet_test_projects"
echo " dotnet new webapi -o TestApi"
echo " cd TestApi"
echo " dotnet run # (and check in browser at http://localhost:5000 or https://localhost:5001)"
echo " cd .."
echo " dotnet new blazorserver -o TestBlazorApp # or blazorwasm"
echo " cd TestBlazorApp"
echo " dotnet run # (and check in browser)"
echo ""
echo "############################################################"
echo "# End of Fedora Specific .NET Setup #"
echo "############################################################"
echo "--- Fedora .NET Development Environment Setup Finished ---"

51
scripts/04-config-symlinks.sh Executable file
View file

@ -0,0 +1,51 @@
#!/bin/bash
# 04-config-symlinks.sh
# Copies Starship config and symlinks dotfiles.
# Relies on SCRIPT_ROOT_DIR being set by the caller.
echo "--- Starting Configuration and Symlinking ---"
if [ -z "$SCRIPT_ROOT_DIR" ]; then
echo "ERROR: SCRIPT_ROOT_DIR must be set in the environment."
exit 1
fi
# Starship Config File
STARSHIP_CONFIG_SOURCE="${SCRIPT_ROOT_DIR}/terminal/starship.toml"
STARSHIP_CONFIG_DEST_DIR="$HOME/.config"
STARSHIP_CONFIG_DEST_FILE="${STARSHIP_CONFIG_DEST_DIR}/starship.toml"
echo "Setting up Starship configuration..."
if [ -f "$STARSHIP_CONFIG_SOURCE" ]; then
mkdir -p "$STARSHIP_CONFIG_DEST_DIR"
cp "$STARSHIP_CONFIG_SOURCE" "$STARSHIP_CONFIG_DEST_FILE"
echo "Copied starship.toml to $STARSHIP_CONFIG_DEST_FILE"
else
echo "WARNING: Starship config source not found: $STARSHIP_CONFIG_SOURCE. Skipping copy."
fi
# Symlink files (keeping the original simple approach)
echo "Symlinking dotfiles..."
FILES=('vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'commit-conventions.txt' 'aliases.zsh')
for file in "${FILES[@]}"; do
echo ""
echo "Symlinking $file to $HOME"
# Check if source file exists first
if [ -e "${SCRIPT_ROOT_DIR}/${file}" ]; then
ln -sf "${SCRIPT_ROOT_DIR}/${file}" "$HOME/.$file"
if [ $? -eq 0 ]; then
echo "${SCRIPT_ROOT_DIR}/${file} ~> $HOME/.$file"
else
echo "Install failed to symlink $file."
exit 1
fi
else
echo "WARNING: Source file not found: ${SCRIPT_ROOT_DIR}/${file}. Skipping."
fi
done
echo "--- Configuration and Symlinking Finished ---"

105
temp_dotnet_checklist.md Normal file
View file

@ -0,0 +1,105 @@
**Fedora 42 DotNet Setup Checklist**
**Important Preliminary Note:**
* [ ] **Fedora 42 Specifics:** Since Fedora 42 is a future release, always double-check the *exact* package names and commands against the official Fedora and Microsoft documentation once Fedora 42 is available. The commands below are based on current Fedora practices.
---
**I. Core .NET Development Environment**
* [ ] **Register Microsoft Package Repository:**
* [ ] Import Microsoft GPG key (e.g., `sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc`).
* [ ] Add Microsoft package repository for Fedora 42 (e.g., `sudo wget https://packages.microsoft.com/config/fedora/42/packages-microsoft-prod.rpm -O packages-microsoft-prod.rpm` - *verify exact URL for F42*).
* [ ] Install the downloaded repository configuration (e.g., `sudo dnf install -y packages-microsoft-prod.rpm`).
* [ ] Clean up downloaded .rpm file (e.g., `rm packages-microsoft-prod.rpm`).
* [ ] **Install .NET SDK:**
* [ ] Install the desired .NET SDK version (e.g., `sudo dnf install -y dotnet-sdk-8.0` or latest LTS).
* [ ] **Verify .NET Installation:**
* [ ] Check SDK version: `dotnet --version`
* [ ] List installed SDKs: `dotnet --list-sdks`
* [ ] List installed runtimes: `dotnet --list-runtimes`
---
**II. Code Editor/IDE (Visual Studio Code Recommended)**
* [ ] **Install Visual Studio Code:**
* [ ] Option A: From Fedora repositories (e.g., `sudo dnf install -y code`).
* [ ] Option B: Download `.rpm` from [code.visualstudio.com](https://code.visualstudio.com/) and install (e.g., `sudo dnf install -y ./<vscode_downloaded_file>.rpm`).
* [ ] **Install Essential VS Code Extensions (Open VS Code to do this):**
* [ ] **C# Dev Kit** (from Microsoft - this is key and bundles other C# tools).
* [ ] (Optional but Recommended) NuGet Package Manager GUI.
* [ ] (Optional but Recommended) GitLens.
* [ ] (Optional but Recommended) Prettier - Code formatter.
* [ ] (Optional) Any Blazor-specific snippet or tooling extensions you find useful.
* [ ] *Restart VS Code if prompted after extension installations.*
---
**III. Version Control**
* [ ] **Install Git:**
* [ ] `sudo dnf install -y git`
* [ ] **Configure Git (Global Settings):**
* [ ] Set user name: `git config --global user.name "Your Name"`
* [ ] Set user email: `git config --global user.email "youremail@example.com"`
---
**IV. Web Browser for Frontend Testing**
* [ ] **Install/Verify Modern Web Browser:**
* [ ] Firefox (usually pre-installed on Fedora).
* [ ] Or, install another like Chromium (e.g., `sudo dnf install -y chromium`) or Google Chrome.
* [ ] *Familiarize yourself with its Developer Tools (Inspector, Console, Network).*
---
**V. Database (Optional - PostgreSQL Example)**
* [ ] **Install PostgreSQL Server & Contrib Packages:**
* [ ] `sudo dnf install -y postgresql-server postgresql-contrib`
* [ ] **Initialize PostgreSQL Database Cluster:**
* [ ] `sudo postgresql-setup --initdb`
* [ ] **Enable and Start PostgreSQL Service:**
* [ ] `sudo systemctl enable --now postgresql`
* [ ] **Create PostgreSQL User and Database (via `psql`):**
* [ ] Access `psql`: `sudo -u postgres psql`
* [ ] Create user: `CREATE USER myappuser WITH PASSWORD 'yoursecurepassword';` (Replace with your details)
* [ ] Create database: `CREATE DATABASE myappdb OWNER myappuser;` (Replace with your details)
* [ ] Exit `psql`: `\q`
* [ ] **(Optional) Install PostgreSQL GUI Tool:**
* [ ] e.g., pgAdmin 4: `sudo dnf install -y pgadmin4`
* [ ] Or DBeaver (download from their website or check Fedora repos).
---
**VI. Containerization (Optional but Recommended)**
* [ ] **Install Docker Engine (moby-engine on Fedora):**
* [ ] `sudo dnf install -y moby-engine`
* [ ] **Enable and Start Docker Service:**
* [ ] `sudo systemctl enable --now docker`
* [ ] **Add User to Docker Group:**
* [ ] `sudo usermod -aG docker $USER`
* [ ] **IMPORTANT: Log out and log back in for this group change to take effect.**
* [ ] **Install Docker Compose:**
* [ ] `sudo dnf install -y docker-compose` (or check official Docker docs for other methods if needed).
* [ ] **Verify Docker Installation:**
* [ ] `docker --version`
* [ ] `docker-compose --version`
* [ ] `docker run hello-world` (after logging back in)
---
**VII. Final Checks**
* [ ] **Reboot (Optional but can ensure all services/paths are correctly initialized):**
* [ ] `sudo reboot`
* [ ] **Create a Test Project:**
* [ ] `dotnet new webapi -o TestApi`
* [ ] `cd TestApi`
* [ ] `dotnet run` (and check in browser)
* [ ] `dotnet new blazorserver -o TestBlazorApp` (or `blazorwasm`)
* [ ] `cd TestBlazorApp`
* [ ] `dotnet run` (and check in browser)

1
zshrc
View file

@ -19,6 +19,7 @@ export PATH="$PATH:$HOME/.cabal/bin:/opt/cabal/1.22/bin:/opt/ghc/7.10.3/bin:$HOM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
export PATH="$PATH:/opt/nvim-linux64/bin"
source $ZSH/oh-my-zsh.sh
source $HOME/dotfiles/aliases.zsh
# source $HOME/.cargo/env