Skip to content
Merged
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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- name: First run
run: ./setup.sh
- name: First run, with a Brewfile.local
run: |
echo 'brew "hello"' > Brewfile.local
./setup.sh
brew list hello > /dev/null # fails if Brewfile.local was skipped
- name: Second run changes nothing
run: |
snapshot() {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Brewfile.local
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ My recommended developer setup for a new Mac (Apple Silicon or Intel), installab
./macos-defaults.sh
```

Want a different selection? Edit the [`Brewfile`](Brewfile) before running `./setup.sh`: comment out what you don't want, uncomment what you do.
Want a different selection? Edit the [`Brewfile`](Brewfile) before running `./setup.sh`: comment out what you don't want, uncomment what you do. To add your own apps and tools, put them in a `Brewfile.local` next to it, in the same format (`brew "lazygit"`, `cask "stats"`). git ignores that file, so `git pull` never conflicts with it.

### What `setup.sh` does

- Installs [Homebrew](https://brew.sh/) if it's missing and adds it to your `PATH` in `~/.zprofile`
- Installs everything in the [`Brewfile`](Brewfile) with `brew bundle`. Apps you already installed yourself, like Chrome, are handed over to Homebrew rather than installed again
- Installs everything in the [`Brewfile`](Brewfile) with `brew bundle`, then everything in your `Brewfile.local` if you have one. Apps you already installed yourself, like Chrome, are handed over to Homebrew rather than installed again
- Adds one `source` line to the end of `~/.zshrc` that loads [`dotfiles/zshrc`](dotfiles/zshrc)
- Adds a `config-file` line to `~/.config/ghostty/config` that loads [`dotfiles/ghostty`](dotfiles/ghostty), which makes **Cmd+K** clear the screen inside herdr and tmux too, and makes the left Option key work as Alt
- Adds a `config-file` line to `~/.config/ghostty/config` that loads [`dotfiles/ghostty`](dotfiles/ghostty), which makes **Cmd+K** clear the screen inside herdr and tmux too, and makes the left Option key work as Alt. A second line loads `~/.config/ghostty/config.local` after it, if you create one, so your settings there override the repo's
- Creates `~/.config/herdr/config.toml` from [`dotfiles/herdr.toml`](dotfiles/herdr.toml) if you don't have one, or adds the tab shortcut to the one you have
- Adds an include to the top of `~/.gitconfig` that loads [`dotfiles/gitconfig`](dotfiles/gitconfig)
- Turns on commit signing with your SSH key, if you have one and haven't set up signing already, and lets git check those signatures (`git log --show-signature`)
Expand Down
2 changes: 2 additions & 0 deletions dotfiles/ghostty
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Loaded from your Ghostty config by setup.sh (config-file = ...). Ghostty
# reads included files last, so these settings override your own config.
# To override them in turn, put your settings in config.local next to your
# Ghostty config: setup.sh loads it after this file.

# Cmd+K: send Ctrl+L instead of Ghostty's own clear_screen. Ghostty skips
# clear_screen while a full-screen app (herdr, tmux) is running and sends the
Expand Down
18 changes: 17 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ step "Apps and tools from the Brewfile"
# The failures are listed at the end.
BUNDLE_FAILED=""
brew bundle --file="$REPO_DIR/Brewfile" || BUNDLE_FAILED=1
# Your own additions, kept out of git so `git pull` never conflicts with them.
BREWFILE_LOCAL="$REPO_DIR/Brewfile.local"
if [[ -f "$BREWFILE_LOCAL" ]]; then
step "Apps and tools from Brewfile.local"
brew bundle --file="$BREWFILE_LOCAL" || BUNDLE_FAILED=1
fi

step "Shell config"
ZSHRC_LINE="source \"$REPO_DIR/dotfiles/zshrc\""
Expand All @@ -81,6 +87,13 @@ else
printf '\n%s\n' "$GHOSTTY_LINE" >> "$GHOSTTY_CONFIG"
note "added to the end of $GHOSTTY_CONFIG (applies to new Ghostty windows)"
fi
# Listed after the repo's file, so it loads later and its settings win. The ? makes it
# optional, and the path is relative to $GHOSTTY_CONFIG.
GHOSTTY_LOCAL_LINE="config-file = ?config.local"
if ! grep -qxF "$GHOSTTY_LOCAL_LINE" "$GHOSTTY_CONFIG"; then
printf '%s\n' "$GHOSTTY_LOCAL_LINE" >> "$GHOSTTY_CONFIG"
note "settings in $(dirname "$GHOSTTY_CONFIG")/config.local now override the repo's"
fi

step "herdr config"
# herdr's config.toml has no include directive, so it is copied rather than linked.
Expand Down Expand Up @@ -198,7 +211,10 @@ fi

if [[ -n "$BUNDLE_FAILED" ]]; then
step "Some Brewfile entries didn't install"
brew bundle check --file="$REPO_DIR/Brewfile" --no-upgrade --verbose 2>&1 | sed 's/^/ /' || true
for brewfile in "$REPO_DIR/Brewfile" "$BREWFILE_LOCAL"; do
[[ -f "$brewfile" ]] || continue
brew bundle check --file="$brewfile" --no-upgrade --verbose 2>&1 | sed 's/^/ /' || true
done
note "Look for \"Error:\" in the brew bundle output above, fix it, then re-run ./setup.sh"
exit 1
fi
Loading