configs

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

commit 63517ad2640057d619f93b6ec4941395adee3437
parent f8a7f028325eb3086f22a9bb83643be428f6db46
Author: Damian Myrda <damian@prime8.dev>
Date:   Mon, 16 Feb 2026 16:42:25 -0600

add macos setup with brewfile and detection in main setup.sh

Diffstat:
Amacos/Brewfile | 27+++++++++++++++++++++++++++
Amacos/link.sh | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amacos/setup.sh | 46++++++++++++++++++++++++++++++++++++++++++++++
Msetup.sh | 8++++++++
4 files changed, 143 insertions(+), 0 deletions(-)

diff --git a/macos/Brewfile b/macos/Brewfile @@ -0,0 +1,27 @@ +# CLI Tools +brew "bat" +brew "btop" +brew "eza" +brew "fish" +brew "neovim" +brew "neovim-remote" +brew "pfetch" +brew "ripgrep" +brew "trash-cli" +brew "tree" +brew "zoxide" + +# Development +brew "fnm" +brew "gh" +brew "go" +brew "node" +brew "openjdk" +brew "opencode" +brew "oven-sh/bun/bun" +brew "pre-commit" +brew "python" +brew "yarn" + +# Fonts +cask "font-jetbrains-mono-nerd-font" diff --git a/macos/link.sh b/macos/link.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)" +PROGRAMS_DIR="$SCRIPT_DIR/programs" +CONFIG_DIR="$HOME/.config" + +echo "🔗 Symlinking config files for macOS..." + +link_config() { + local src="$1" + local dest="$2" + + echo "→ Linking $src → $dest" + + if [ -L "$dest" ] || [ -d "$dest" ]; then + echo "→ Removing existing $dest" + rm -rf "$dest" + elif [ -e "$dest" ]; then + echo "→ Backing up existing $dest to $dest.bak" + mv "$dest" "$dest.bak" + fi + + mkdir -p "$(dirname "$dest")" + ln -s "$src" "$dest" + echo "✅ Linked $dest" +} + +# Fish +link_config "$PROGRAMS_DIR/fish/config.fish" "$CONFIG_DIR/fish/config.fish" +link_config "$PROGRAMS_DIR/fish/fish_plugins" "$CONFIG_DIR/fish/fish_plugins" +link_config "$PROGRAMS_DIR/fish/secrets.fish" "$CONFIG_DIR/fish/secrets.fish" + +# Neovim +link_config "$PROGRAMS_DIR/nvim" "$CONFIG_DIR/nvim" + +# Btop +link_config "$PROGRAMS_DIR/btop/btop.conf" "$CONFIG_DIR/btop/btop.conf" + +# Git +link_config "$PROGRAMS_DIR/git/config" "$HOME/.gitconfig" + +# GitHub CLI +link_config "$PROGRAMS_DIR/gh/config.yml" "$CONFIG_DIR/gh/config.yml" + +# OpenCode +link_config "$PROGRAMS_DIR/opencode/opencode.json" "$CONFIG_DIR/opencode/opencode.json" +link_config "$PROGRAMS_DIR/opencode/command" "$CONFIG_DIR/opencode/command" +link_config "$PROGRAMS_DIR/opencode/plugin" "$CONFIG_DIR/opencode/plugin" + +# SSH +link_config "$PROGRAMS_DIR/ssh/config" "$HOME/.ssh/config" + +# Karabiner +link_config "$PROGRAMS_DIR/karabiner/karabiner.json" "$CONFIG_DIR/karabiner/karabiner.json" +link_config "$PROGRAMS_DIR/karabiner/assets" "$CONFIG_DIR/karabiner/assets" + +# Zed (macOS native path) +link_config "$PROGRAMS_DIR/zed/settings.jsonc" "$CONFIG_DIR/zed/settings.json" +link_config "$PROGRAMS_DIR/zed/keymap.jsonc" "$CONFIG_DIR/zed/keymap.json" + +echo "✅ macOS config symlinks complete!" diff --git a/macos/setup.sh b/macos/setup.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +echo "🔧 Starting macOS setup..." + +# Hostname +HOSTNAME="macbox" +echo "🖥️ Setting system hostname to '$HOSTNAME'..." +sudo scutil --set HostName "$HOSTNAME" && echo "✅ HostName set" +sudo scutil --set ComputerName "$HOSTNAME" && echo "✅ ComputerName set" +sudo scutil --set LocalHostName "$HOSTNAME" && echo "✅ LocalHostName set" + +# Dock +echo "📦 Configuring Dock preferences..." +defaults write com.apple.dock orientation -string "left" && echo "✅ Dock position set to left" +defaults write com.apple.dock autohide -bool true && echo "✅ Dock autohide enabled" +defaults write com.apple.dock autohide-delay -float 0 && echo "✅ Dock autohide delay set" +defaults write com.apple.dock no-bouncing -bool true && echo "✅ Dock bounce disabled" +killall Dock 2>/dev/null && echo "🔄 Dock restarted" || true + +# Windows +defaults write -g NSWindowShouldDragOnGesture -bool true && echo "✅ Window drag by gesture enabled" + +# 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 +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" +else + echo "❌ Brewfile not found at $BREWFILE_PATH" + exit 1 +fi +brew cleanup && echo "✅ Homebrew cleanup completed" + +# Symlink configs +"$SCRIPT_DIR/link.sh" + +echo "✅ macOS setup complete!" diff --git a/setup.sh b/setup.sh @@ -2,6 +2,14 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Detect OS and run appropriate setup +if [[ "$(uname -s)" == "Darwin" ]]; then + echo "macOS detected, running macos/setup.sh..." + exec "$SCRIPT_DIR/macos/setup.sh" + exit +fi + FEDORA_DIR="$SCRIPT_DIR/fedora" # COPR repos