The MCP servers in mcp-config/ are npm packages that opencode spawns as `npx -y <pkg>`. Without npx on PATH they all fail to start, and opencode reports that only as a dead server -- easy to misread as a broken config. Node is a tree, not a single binary, so it follows the ansible module: unpack under ~/.local/opt and symlink the CLIs into ~/.local/bin. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
44 lines
1.7 KiB
Bash
Executable File
44 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
# bootstrap.sh — entrypoint for configuring a fresh VM (RHEL-family or
|
|
# Debian-family) with this repo's dotfiles. Safe to re-run.
|
|
#
|
|
# curl -fsSL https://git.nic-oconnor.com/public/dotfiles/raw/branch/main/bootstrap.sh | sh
|
|
# (or, from a checked-out clone: ./bootstrap.sh)
|
|
set -eu
|
|
|
|
REPO_URL="${DOTFILES_REPO:-https://git.nic-oconnor.com/public/dotfiles.git}"
|
|
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}"
|
|
|
|
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
|
|
# When curl-piped into `sh`, there is no checkout on disk: $0 is not a real
|
|
# path, so the module scripts alongside this file are missing. Clone (or
|
|
# update) the repo, then re-exec bootstrap.sh from the checkout.
|
|
if [ ! -f "$SCRIPT_DIR/zsh/install.sh" ]; then
|
|
if ! command -v git >/dev/null 2>&1; then
|
|
echo "bootstrap: git is required to self-clone; install git first" >&2
|
|
exit 1
|
|
fi
|
|
if [ -d "$DOTFILES_DIR/.git" ]; then
|
|
echo "bootstrap: updating existing checkout at $DOTFILES_DIR"
|
|
git -C "$DOTFILES_DIR" pull --ff-only
|
|
else
|
|
echo "bootstrap: cloning $REPO_URL into $DOTFILES_DIR"
|
|
git clone "$REPO_URL" "$DOTFILES_DIR"
|
|
fi
|
|
exec "$DOTFILES_DIR/bootstrap.sh"
|
|
fi
|
|
|
|
"$SCRIPT_DIR/zsh/install.sh"
|
|
"$SCRIPT_DIR/git/install.sh"
|
|
# Runs before bin/ so the kind install gate can see the rootful daemon.
|
|
"$SCRIPT_DIR/docker/install.sh"
|
|
"$SCRIPT_DIR/bin/install.sh"
|
|
# Provides npx, which opencode needs to spawn the npm-based MCP servers in
|
|
# mcp-config/. Without it every MCP server silently fails to start.
|
|
"$SCRIPT_DIR/node/install.sh"
|
|
"$SCRIPT_DIR/ansible/install.sh"
|
|
# Runs last: needs rootless Docker already up (started at boot) so it can
|
|
# delegate cgroups to it. No-ops where that does not apply.
|
|
"$SCRIPT_DIR/docker-rootless-cgroup/install.sh"
|