#!/bin/bash # run_once_10-install-base.sh # Installs base and some programming packages set -euo pipefail SYS="$(chezmoi data --format=json 2>/dev/null | jq -r '.system // "desktop"')" DISTRO_ID="$(chezmoi data --format=json 2>/dev/null | jq -r '.chezmoi.osRelease.id // empty')" case "$DISTRO_ID" in arch) echo ">>> [base] arch, system=$SYS" sudo pacman -Syu --noconfirm sudo pacman -S --noconfirm --needed \ networkmanager networkmanager-openvpn wireguard-tools fastfetch \ inotify-tools libqalculate cifs-utils reflector os-prober ntfs-3g \ openssh upower expac unzip less curl wget gawk zip tar \ eza bat fzf fd jq go if [ "$SYS" != "server" ]; then sudo pacman -S --noconfirm --needed \ jdk-openjdk maven rustup npm rustup default stable >/dev/null 2>&1 || true fi # AUR helper if ! command -v yay >/dev/null 2>&1; then sudo pacman -S --noconfirm --needed base-devel 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 # 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 rustup default stable >/dev/null 2>&1 || true fi ;; *) echo ">>> [base] unsupported distro: ${DISTRO_ID:-unknown}, skipping" exit 0 ;; esac echo ">>> [base] done"