#!/bin/bash # run_once_10-install-base.sh # Installs base packages set -euo pipefail warn() { echo ">>> [base] WARNING: $*" >&2; } SYS="{{ .system | default "desktop" }}" DISTRO_ID="{{ .chezmoi.osRelease.id | default "" }}" case "$DISTRO_ID" in arch) echo ">>> [base] arch, system=$SYS" sudo pacman -Syu --noconfirm --needed \ networkmanager-openvpn wireguard-tools base-devel \ inotify-tools libqalculate cifs-utils reflector os-prober ntfs-3g \ openssh upower expac unzip less curl wget gawk zip tar \ btop fastfetch yazi eza bat fzf fd jq go npm python-pipx \ fish zoxide starship sshfs man-db man-pages p7zip ripgrep resvg \ lazygit exiftool testdisk if [ "$SYS" != "server" ]; then sudo pacman -Syu --noconfirm --needed \ dbeaver mariadb \ jdk-openjdk maven rustup \ dotnet-sdk docker docker-compose rustup default stable >/dev/null 2>&1 || warn "rustup default stable failed" fi # AUR helper if ! command -v yay >/dev/null 2>&1; then tmp=$(mktemp -d) git clone https://aur.archlinux.org/yay.git "$tmp" ( cd "$tmp" && makepkg -si --noconfirm ) rm -rf "$tmp" fi ;; ubuntu) echo ">>> [base] ubuntu, system=$SYS" sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y \ network-manager openvpn wireguard-tools inotify-tools libqalculate \ cifs-utils os-prober ntfs-3g openssh upower unzip less curl wget \ gawk zip tar fzf fd-find jq \ fish sshfs man-db manpages p7zip-full ripgrep \ libimage-exiftool-perl tesseract-ocr tesseract-ocr-eng # fdfind → fd compatibility symlink # if command -v fdfind >/dev/null 2>&1 && ! command -v fd >/dev/null 2>&1; then # sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd # fi if [ "$SYS" != "server" ]; then sudo apt-get install -y \ openjdk-17-jdk maven rustup npm golang-go \ dotnet-sdk-8.0 docker-compose rustup default stable >/dev/null 2>&1 || warn "rustup default stable failed" fi ;; *) echo ">>> [base] unsupported distro: ${DISTRO_ID:-unknown}, skipping" exit 0 ;; esac echo ">>> [base] done"