From 3da122d6be6c13dcf8ebf484a61a916de07d1289 Mon Sep 17 00:00:00 2001 From: Jan Ehrhardt Date: Wed, 1 Oct 2025 14:53:27 +0200 Subject: [PATCH] Revert "Remove setup script" This reverts commit c4dd1c507ff5c8ea4859d0fe829f53e8382894d6. --- run_once_after_setup.sh | 122 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100755 run_once_after_setup.sh diff --git a/run_once_after_setup.sh b/run_once_after_setup.sh new file mode 100755 index 0000000..b574cc3 --- /dev/null +++ b/run_once_after_setup.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +log_info() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +log_warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +log_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +# Check if running on Arch Linux +if ! command -v pacman &> /dev/null; then + log_error "This script requires Arch Linux (pacman not found)" + exit 1 +fi + +log_info "Starting package installation..." + +# Install base prerequisites for paru with pacman +log_info "Installing base packages with pacman..." +sudo pacman -S --needed --noconfirm base-devel fish rustup + +# Set fish as default shell before setting up Rust +log_info "Setting fish as default shell..." +FISH_PATH=$(which fish) + +# Add fish to /etc/shells if not already present +if ! grep -q "^$FISH_PATH$" /etc/shells; then + echo "$FISH_PATH" | sudo tee -a /etc/shells + log_info "Added fish to /etc/shells" +else + log_info "Fish already in /etc/shells" +fi + +# Change default shell to fish +if [ "$SHELL" != "$FISH_PATH" ]; then + chsh -s "$FISH_PATH" + log_info "Changed default shell to fish (will take effect on next login)" +else + log_info "Fish is already the default shell" +fi + +# Configure rustup with stable toolchain +log_info "Setting up Rust stable toolchain..." +rustup default stable + +# Install paru AUR helper if not already installed +if ! command -v paru &> /dev/null; then + log_info "Installing paru AUR helper..." + + # Create temporary directory for paru installation + TEMP_DIR=$(mktemp -d) + cd "$TEMP_DIR" + + # Clone and build paru + git clone https://aur.archlinux.org/paru.git + cd paru + makepkg -si --noconfirm + + # Clean up + cd / + rm -rf "$TEMP_DIR" + + log_info "paru installed successfully" +else + log_info "paru already installed, skipping..." +fi + +# Install required packages with paru +log_info "Installing required packages ..." +paru -S --needed --noconfirm \ + alacritty \ + atuin \ + bat \ + less \ + chezmoi \ + mise \ + yazi \ + btop \ + impala \ + lazydocker \ + docker \ + docker-buildx \ + docker-compose \ + lazygit \ + starship \ + ttf-firacode-nerd \ + mako \ + hyprland \ + walker-bin \ + waybar \ + hypridle \ + hyprlock \ + libnotify \ + blueberry \ + brightnessctl \ + btop \ + ripgrep \ + fd \ + eza \ + zoxide \ + tree-sitter-cli \ + neovim \ + xdg-desktop-portal-gtk \ + xdg-desktop-portal-hyprland \ + qt5-wayland \ + qt6-wayland \ + hyprpolkitagent + +log_info "All packages installed and configured successfully!" -- 2.51.2