Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Bun global configuration — https://bun.com/docs/runtime/bunfig
#
# Lives at the repo root because bun's global config path is
# $XDG_CONFIG_HOME/.bunfig.toml and $XDG_CONFIG_HOME points at this repo.
# assimilate.sh also symlinks it to ~/.bunfig.toml for contexts where
# XDG_CONFIG_HOME isn't exported (bun ignores ~/.bunfig.toml whenever
# XDG_CONFIG_HOME is set — verified against bun 1.3.12).
# A project-local bunfig.toml is merged on top, so repos can still override.

[install]
# Supply-chain hardening: never resolve a package version younger than 7 days
# (value is in seconds). Same rolling window as uv's exclude-newer — most
# malicious/compromised uploads are detected and yanked within a week, so
# resolution just falls back to the newest version that clears the window.
# Requires bun >= 1.2.22 (older bun ignores unknown bunfig keys).
minimumReleaseAge = 604800
23 changes: 23 additions & 0 deletions assimilate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ sym agent-instructions.md .claude/CLAUDE.md
sym agent-instructions.md .codex/AGENTS.md
sym ssh/config .ssh/config
sym uv/uv.toml .config/uv/uv.toml
# bun reads $XDG_CONFIG_HOME/.bunfig.toml (the repo root) in shells; the
# symlink covers contexts where XDG_CONFIG_HOME isn't exported.
sym .bunfig.toml .bunfig.toml

# Lock down sensitive symlink targets (chmod follows the symlink to the repo file).
chmod 600 "$HOME/.gitconfig"
Expand All @@ -87,6 +90,12 @@ else
fi
fi

# npm: refuse package versions younger than 7 days. Append-only because
# ~/.npmrc may also contain authentication written by `npm login`.
if ! grep -q '^min-release-age=' "$HOME/.npmrc" 2>/dev/null; then
echo 'min-release-age=7' >> "$HOME/.npmrc"
fi

# macOS-only symlinks and Homebrew (apps/paths don't exist on Linux)
if [ "$OS" = "Darwin" ]; then
sym hammerspoon .hammerspoon
Expand Down Expand Up @@ -257,4 +266,18 @@ if command -v nvim >/dev/null; then
nvim --headless "+Lazy! restore" +qa || true
fi

# Configure Claude Code defaults. Appends each key only when it is absent, so
# existing machine-local settings are never overridden.
CLAUDE_SETTINGS="$HOME/.claude/settings.json"
mkdir -p "$HOME/.claude"
if [ ! -f "$CLAUDE_SETTINGS" ]; then
printf '{\n "attribution": { "commit": "", "pr": "" },\n "statusLine": { "type": "command", "command": "~/.claude/statusline.sh", "padding": 0 }\n}\n' > "$CLAUDE_SETTINGS"
elif ! jq -e 'has("attribution") and has("statusLine")' "$CLAUDE_SETTINGS" >/dev/null 2>&1; then
tmp=$(mktemp)
jq '
if has("attribution") then . else . + {attribution: {commit: "", pr: ""}} end
| if has("statusLine") then . else . + {statusLine: {type: "command", command: "~/.claude/statusline.sh", padding: 0}} end
' "$CLAUDE_SETTINGS" > "$tmp" && mv "$tmp" "$CLAUDE_SETTINGS"
fi

echo "> Assimilation successful!"