configs

configs
git clone https://git.prime8.dev/configs.git
Log | Files | Refs | README

commit 389e09d6e8713a5c093493bdbcc8f4e2ea4ba212
parent f9998f00f8a3e15c9860c34a620e1e47b06696a9
Author: Damian Myrda <damian@prime8.dev>
Date:   Tue, 27 Jan 2026 13:02:49 -0600

rewrite setup.sh for Fedora Atomic with rpm-ostree package layering

Diffstat:
Msetup.sh | 157+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 141 insertions(+), 16 deletions(-)

diff --git a/setup.sh b/setup.sh @@ -2,26 +2,151 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +FEDORA_DIR="$SCRIPT_DIR/fedora" -# Homebrew -echo "🍺 Installing Homebrew packages with Brewfile..." -if ! command -v brew >/dev/null 2>&1; then - echo "❌ Homebrew not found. Please install it first: https://brew.sh" - exit 1 +# --- COPR Repos --- +echo "Enabling COPR repositories..." +while IFS= read -r repo || [ -n "$repo" ]; do + [ -z "$repo" ] && continue + owner="${repo%%/*}" + name="${repo##*/}" + repo_id="copr:copr.fedorainfracloud.org:${owner}:${name}" + repo_file="/etc/yum.repos.d/_copr_${owner}-${name}.repo" + + if [ -f "$repo_file" ]; then + echo "COPR already enabled: $repo" + continue + fi + + echo "Adding COPR: $repo" + sudo tee "$repo_file" >/dev/null <<EOF +[$repo_id] +name=Copr repo for $name owned by $owner +baseurl=https://download.copr.fedorainfracloud.org/results/$repo/fedora-\$releasever-\$basearch/ +type=rpm-md +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://download.copr.fedorainfracloud.org/results/$repo/pubkey.gpg +repo_gpgcheck=0 +enabled=1 +enabled_metadata=1 +EOF +done <"$FEDORA_DIR/copr.txt" + +# --- OBS Repos --- +echo "Enabling OBS repositories..." +while IFS= read -r repo || [ -n "$repo" ]; do + [ -z "$repo" ] && continue + name="${repo##*:}" + repo_file="/etc/yum.repos.d/${name}.repo" + + if [ -f "$repo_file" ]; then + echo "OBS already enabled: $repo" + continue + fi + + echo "Adding OBS: $repo" + obs_path="${repo//://}" + sudo tee "$repo_file" >/dev/null <<EOF +[home_${name}] +name=${repo} (Fedora_\$releasever) +type=rpm-md +baseurl=https://download.opensuse.org/repositories/${obs_path}/Fedora_\$releasever/ +gpgcheck=1 +gpgkey=https://download.opensuse.org/repositories/${obs_path}/Fedora_\$releasever/repodata/repomd.xml.key +enabled=1 +EOF +done <"$FEDORA_DIR/obs.txt" + +# --- Vendor Repos --- +echo "Checking vendor repositories..." +while IFS= read -r repo || [ -n "$repo" ]; do + [ -z "$repo" ] && continue + case "$repo" in + 1password) + repo_file="/etc/yum.repos.d/1password.repo" + if [ ! -f "$repo_file" ]; then + echo "Adding 1Password repo..." + sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc + sudo tee "$repo_file" >/dev/null <<EOF +[1password] +name=1Password Stable Channel +baseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch +enabled=1 +gpgcheck=1 +repo_gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/1password.asc +EOF + else + echo "Already enabled: 1password" + fi + ;; + google-chrome) + repo_file="/etc/yum.repos.d/google-chrome.repo" + if [ ! -f "$repo_file" ]; then + echo "Adding Google Chrome repo..." + sudo tee "$repo_file" >/dev/null <<EOF +[google-chrome] +name=google-chrome +baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64 +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://dl.google.com/linux/linux_signing_key.pub +enabled=0 +EOF + else + echo "Already enabled: google-chrome" + fi + ;; + *) + echo "Unknown vendor repo: $repo" + ;; + esac +done <"$FEDORA_DIR/repos.txt" + +# --- RPM Fusion --- +echo "Checking RPM Fusion repositories..." +while IFS= read -r repo || [ -n "$repo" ]; do + [ -z "$repo" ] && continue + if [ -f "/etc/yum.repos.d/${repo}.repo" ]; then + echo "Already enabled: $repo" + continue + fi + + echo "Adding $repo..." + type="${repo#rpmfusion-}" + sudo rpm-ostree install --idempotent \ + "https://mirrors.rpmfusion.org/${type}/fedora/rpmfusion-${type}-release-$(rpm -E %fedora).noarch.rpm" +done <"$FEDORA_DIR/rpmfusion.txt" + +# --- Layer RPM Packages --- +echo "Layering packages with rpm-ostree..." +mapfile -t packages < <(sed 's/#.*//;/^$/d' "$FEDORA_DIR/packages.txt") +sudo rpm-ostree install --idempotent "${packages[@]}" + +echo "Reboot to apply layered packages: systemctl reboot" + +# --- Manual Installs (no reboot needed) --- + +# bun +if ! command -v bun &>/dev/null; then + echo "Installing bun..." + curl -fsSL https://bun.sh/install | bash fi -brew update && echo "✅ Homebrew updated" -brew upgrade && echo "✅ Homebrew upgraded" -BREWFILE_PATH="${SCRIPT_DIR}/Brewfile" -if [ -f "$BREWFILE_PATH" ]; then - brew bundle --file="$BREWFILE_PATH" && echo "✅ Brewfile installed successfully" - brew bundle check --file="$BREWFILE_PATH" && echo "✅ Brewfile verification passed" || echo "⚠️ Brewfile verification issues" -else - echo "❌ Brewfile not found at $BREWFILE_PATH" - exit 1 + +# opencode +if ! command -v opencode &>/dev/null; then + echo "Installing opencode..." + curl -fsSL https://opencode.ai/install | bash +fi + +# neovim-remote +if ! command -v nvr &>/dev/null; then + echo "Installing neovim-remote..." + pip install --user neovim-remote fi -brew cleanup && echo "✅ Homebrew cleanup completed" # Symlink configs "$SCRIPT_DIR/link.sh" -echo "✅ Setup script completed!" +echo "Setup complete!"