diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0dcf604..f4a3184 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,6 +21,7 @@ jobs: - name: Build run: cargo build --release - name: Upload files to a GitHub release + if: github.event_name == 'push' uses: svenstaro/upload-release-action@2.9.0 with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/nests/mac/.shenv b/nests/mac/.shenv index 4742719..6a77233 100644 --- a/nests/mac/.shenv +++ b/nests/mac/.shenv @@ -1,42 +1,14 @@ #! /bin/sh -echo "Welcome Tylord" - -# Owl Conifg -export OWL_PATH="/Users/tylertracy/owl" -export OWL_CONFIG_PATH="$OWL_PATH/nests/mac/nest.json" - -# XDG vars -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_RUNTIME_DIR=/tmp/$(whoami)/runtime_dir -mkdir -p $XDG_RUNTIME_DIR - -# Programs -export EDITOR='vim' - -# Local bin -export PATH="$HOME/.local/bin:$PATH" - - -# Load aliases -source ~/.config/alias/main - -# Run owl-rc -for file in ~/.config/owl-rc/*; do - [ -f "$file" ] && source "$file" -done - -# Brew -eval "$(/opt/homebrew/bin/brew shellenv)" - -# Bun -[ -s "/Users/tylertracy/.bun/_bun" ] && source "/Users/tylertracy/.bun/_bun" -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" - -# Modular -export MODULAR_HOME="$HOME/.modular" -export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH" +# Owl config +export OWL_PATH="$HOME/owl" + +# Editor +export EDITOR='nvim' + +# Homebrew (Apple Silicon and Intel paths; conditional so missing brew is silent) +if [ -x /opt/homebrew/bin/brew ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +elif [ -x /usr/local/bin/brew ]; then + eval "$(/usr/local/bin/brew shellenv)" +fi diff --git a/nests/mac/setup.json b/nests/mac/setup.json index f8a2fc2..15ea6de 100644 --- a/nests/mac/setup.json +++ b/nests/mac/setup.json @@ -1,27 +1,29 @@ { "links": [ { - "source": "target/debug/owl", - "target": "~/.local/bin/owl" - }, - { - "source": "common/config/.vimrc", + "source": "common:config/.vimrc", "target": "~/.vimrc" } ], "dependencies": [ + "owl", "git", "node", "nvim", "tmux", "zsh-ohmy", "ranger", - "notes" + "notes", + "bun", + "rust", + "claude-code", + "codex" ], "rc_scripts": [ "common:fzf.sh", "common:base-aliases.sh", + "common:claude.sh", "local:.shenv", "local:.alias" ] -} \ No newline at end of file +} diff --git a/setups/claude-code/install.sh b/setups/claude-code/install.sh index 8ba7ea0..3f92295 100755 --- a/setups/claude-code/install.sh +++ b/setups/claude-code/install.sh @@ -1,5 +1,12 @@ #!/bin/bash set -euo pipefail +# Make sure bun is on PATH (the rc script that adds it isn't sourced inside install scripts) +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +if [ -f "$SCRIPT_DIR/../bun/bun-rc.sh" ]; then + # shellcheck disable=SC1091 + source "$SCRIPT_DIR/../bun/bun-rc.sh" +fi + # Install claude code globally via bun bun install -g @anthropic-ai/claude-code diff --git a/setups/codex/install.sh b/setups/codex/install.sh new file mode 100755 index 0000000..05e26c8 --- /dev/null +++ b/setups/codex/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail + +# Make sure bun is on PATH (the rc script that adds it isn't sourced inside install scripts) +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +if [ -f "$SCRIPT_DIR/../bun/bun-rc.sh" ]; then + # shellcheck disable=SC1091 + source "$SCRIPT_DIR/../bun/bun-rc.sh" +fi + +# Install OpenAI Codex CLI globally via bun +bun install -g @openai/codex diff --git a/setups/codex/setup.json b/setups/codex/setup.json new file mode 100644 index 0000000..9fcc0db --- /dev/null +++ b/setups/codex/setup.json @@ -0,0 +1,5 @@ +{ + "name": "codex", + "dependencies": ["bun"], + "install": "local:install.sh" +} diff --git a/setups/nvim/install.sh b/setups/nvim/install.sh index ff23e4f..85e1360 100755 --- a/setups/nvim/install.sh +++ b/setups/nvim/install.sh @@ -1,4 +1,48 @@ +#!/bin/bash +set -euo pipefail -curl -L https://github.com/neovim/neovim/releases/download/v0.11.4/nvim-linux-x86_64.appimage -o /tmp/nvim-download -chmod +x /tmp/nvim-download -mv /tmp/nvim-download ~/.local/bin/nvim +if command -v nvim &> /dev/null; then + echo "nvim already installed at $(command -v nvim). Skipping." + exit 0 +fi + +NVIM_VERSION="v0.11.4" +mkdir -p "$HOME/.local/bin" + +case "$(uname -s)" in + Linux) + ARCH=$(uname -m) + URL="https://github.com/neovim/neovim/releases/download/${NVIM_VERSION}/nvim-linux-${ARCH}.appimage" + echo "Downloading neovim AppImage for Linux ($ARCH)..." + curl -L "$URL" -o /tmp/nvim-download + chmod +x /tmp/nvim-download + mv /tmp/nvim-download "$HOME/.local/bin/nvim" + ;; + Darwin) + if command -v brew &> /dev/null; then + echo "Installing neovim via Homebrew..." + brew install neovim + else + ARCH=$(uname -m) + case "$ARCH" in + arm64) ASSET="nvim-macos-arm64" ;; + x86_64) ASSET="nvim-macos-x86_64" ;; + *) echo "Unsupported macOS arch: $ARCH"; exit 1 ;; + esac + URL="https://github.com/neovim/neovim/releases/download/${NVIM_VERSION}/${ASSET}.tar.gz" + echo "Downloading neovim tarball for macOS ($ARCH)..." + TMPDIR=$(mktemp -d) + curl -L "$URL" -o "$TMPDIR/nvim.tar.gz" + tar -xzf "$TMPDIR/nvim.tar.gz" -C "$TMPDIR" + mkdir -p "$HOME/.local/share/nvim-dist" + rm -rf "$HOME/.local/share/nvim-dist/${ASSET}" + mv "$TMPDIR/${ASSET}" "$HOME/.local/share/nvim-dist/${ASSET}" + ln -sf "$HOME/.local/share/nvim-dist/${ASSET}/bin/nvim" "$HOME/.local/bin/nvim" + rm -rf "$TMPDIR" + fi + ;; + *) + echo "Unsupported OS: $(uname -s)" + exit 1 + ;; +esac diff --git a/setups/owl/install.sh b/setups/owl/install.sh index c82cda0..58e30ab 100755 --- a/setups/owl/install.sh +++ b/setups/owl/install.sh @@ -2,14 +2,15 @@ set -e -if ! command -v owl >/dev/null 2>&1; then +if command -v owl >/dev/null 2>&1 || [ -x "$HOME/.local/bin/owl" ] || [ -x "/usr/local/bin/owl" ]; then + echo "owl already installed" +else echo "Installing owl binary from GitHub releases..." tmp=$(mktemp) curl -fsSL https://github.com/tylerthecoder/owl/releases/download/main/owl -o "$tmp" chmod +x "$tmp" - sudo mv "$tmp" /usr/local/bin/owl -else - echo "owl already installed" + mkdir -p "$HOME/.local/bin" + mv "$tmp" "$HOME/.local/bin/owl" fi # Note: Dependencies (git, rust) are handled by the nest/setup that depends on owl diff --git a/setups/rust/install.sh b/setups/rust/install.sh index 0f9d000..b8b0458 100755 --- a/setups/rust/install.sh +++ b/setups/rust/install.sh @@ -20,6 +20,10 @@ else # Ubuntu/Debian echo "Detected Ubuntu/Debian, installing rustup via official installer..." curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + elif [ "$(uname)" = "Darwin" ]; then + # macOS + echo "Detected macOS, installing rustup via official installer..." + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y else echo "Unsupported operating system. Please install rustup manually." exit 1 diff --git a/setups/zsh-ohmy/.zshrc b/setups/zsh-ohmy/.zshrc index 2dd3a51..e276951 100644 --- a/setups/zsh-ohmy/.zshrc +++ b/setups/zsh-ohmy/.zshrc @@ -1,6 +1,5 @@ - -# Source environment variables -source ~/.shenv +# Source owl startup script (XDG vars, PATH, and ~/.config/owl/rc/*) +[ -f "$HOME/owl/owl-start.sh" ] && source "$HOME/owl/owl-start.sh" export ZSH="$HOME/.oh-my-zsh" @@ -10,9 +9,9 @@ zstyle ':omz:update' mode auto # update automatically without asking zstyle ':omz:update' frequency 13 # How often to auto-update (in days). -plugins=(git git-trim colored-man-pages colorize pip python brew zsh-autosuggestions zsh-syntax-highlighting) +plugins=(git colored-man-pages colorize pip python brew zsh-autosuggestions zsh-syntax-highlighting) -source $ZSH/oh-my-zsh.sh +[ -f "$ZSH/oh-my-zsh.sh" ] && source "$ZSH/oh-my-zsh.sh" # Enable command auto-correction. ENABLE_CORRECTION="true" @@ -22,18 +21,10 @@ autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line -# Uncomment the following line to display red dots whilst waiting for completion. -# You can also set it to another string to have that shown instead of the default red dots. -# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" -# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) COMPLETION_WAITING_DOTS="true" -# Kube completions -source <(kubectl completion zsh) - +# Kubectl completions (only if installed) +command -v kubectl >/dev/null 2>&1 && source <(kubectl completion zsh) # bun completions -[ -s "/Users/tylertracy/.bun/_bun" ] && source "/Users/tylertracy/.bun/_bun" - -### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT) -export PATH="/Users/tylertracy/.rd/bin:$PATH" +[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" diff --git a/setups/zsh-ohmy/install.sh b/setups/zsh-ohmy/install.sh new file mode 100755 index 0000000..89c290e --- /dev/null +++ b/setups/zsh-ohmy/install.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -euo pipefail + +ZSH_DIR="${ZSH:-$HOME/.oh-my-zsh}" +ZSH_CUSTOM="${ZSH_CUSTOM:-$ZSH_DIR/custom}" + +if [ ! -d "$ZSH_DIR" ]; then + echo "Installing oh-my-zsh..." + # KEEP_ZSHRC=yes so the installer doesn't overwrite our owl-managed ~/.zshrc symlink + RUNZSH=no CHSH=no KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +else + echo "oh-my-zsh already installed at $ZSH_DIR" +fi + +if [ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]; then + echo "Installing zsh-autosuggestions..." + git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions" +fi + +if [ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]; then + echo "Installing zsh-syntax-highlighting..." + git clone https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" +fi diff --git a/setups/zsh-ohmy/setup.json b/setups/zsh-ohmy/setup.json index 882ab93..5b5c49e 100644 --- a/setups/zsh-ohmy/setup.json +++ b/setups/zsh-ohmy/setup.json @@ -1,5 +1,6 @@ { "name": "zsh", + "install": "local:install.sh", "links": [ { "source": "setups/zsh-ohmy/.zshrc",