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
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
# Enable version updates for npm dependencies
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5
labels:
- "dependencies"
commit-message:
prefix: "npm"
include: "scope"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run lint
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ git/gitconfig.local.symlink
*.local
local/config.json
local/automount.sh
.env
.env

# Node.js
node_modules/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"useTabs": true,
"plugins": ["prettier-plugin-sh"]
}
18 changes: 10 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ Understanding these patterns is critical for working efficiently in this project
#### Within Topic Directories

- **`*.zsh`**: Shell scripts that get automatically sourced into the zsh environment
- Recommended prefixes: `env.zsh` (environment variables), `path.zsh` (PATH modifications), `alias.zsh` (command aliases), `hook.zsh` (shell hooks)
- Example: `git/alias.zsh`, `python/env.zsh`
- Recommended prefixes: `env.zsh` (environment variables), `path.zsh` (PATH modifications), `alias.zsh` (command aliases), `hook.zsh` (shell hooks)
- Example: `git/alias.zsh`, `python/env.zsh`

- **`*.symlink`**: Files that get automatically symlinked to `$HOME` (without the `.symlink` extension)
- Example: `git/gitconfig.symlink` � `~/.gitconfig`
- Example: `zsh/zshrc.symlink` � `~/.zshrc`
- Example: `git/gitconfig.symlink` � `~/.gitconfig`
- Example: `zsh/zshrc.symlink` � `~/.zshrc`

- **`preinstall.sh`**: Scripts executed during bootstrap BEFORE Homebrew runs
- Use for setup that must happen before package installation
- Example: `homebrew/preinstall.sh` (installs Homebrew itself)
- Use for setup that must happen before package installation
- Example: `homebrew/preinstall.sh` (installs Homebrew itself)

- **`install.sh`**: Scripts executed during bootstrap AFTER Homebrew runs
- Use for post-installation configuration and setup
- Example: `macos/install.sh` (installs macOS applications)
- Use for post-installation configuration and setup
- Example: `macos/install.sh` (installs macOS applications)

#### Root Directory Special Files

Expand Down Expand Up @@ -80,6 +80,7 @@ Understanding the execution order is important for making modifications:
### Adding Homebrew Packages

Edit `Brewfile` in the root directory. Use these formats:

- `brew "package-name"` for command-line tools
- `cask "app-name"` for GUI applications
- `mas "App Name", id: 123456` for Mac App Store applications
Expand Down Expand Up @@ -163,6 +164,7 @@ When making changes, always update documentation:
## Testing Changes

To test changes without affecting the user's system:

1. Review what symlinks will be created
2. Check what Homebrew packages will be installed
3. Consider running individual `install.sh` scripts rather than full bootstrap
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ source .env

From here you may want to take a moment to review the dotfiles:

* Applications in the `Brewfile` that are no longer relevant?
* Applications in `macos/install.sh` that you don't use any more?
* Go through the `macos/set-defaults.sh` to see if you still like all of those settings.
- Applications in the `Brewfile` that are no longer relevant?
- Applications in `macos/install.sh` that you don't use any more?
- Go through the `macos/set-defaults.sh` to see if you still like all of those settings.

### Step 3: Intall the dotfiles

Expand All @@ -59,7 +59,7 @@ You can re-run `./bootstrap.sh` whenever you feel inspired.

### Step 4: Setting MacOS Defaults (Optional)

I suppose every step is optional, but this one really is. You can set up a series of MacOS defaults by running:
I suppose every step is optional, but this one really is. You can set up a series of MacOS defaults by running:

```
cd ~/.dotfiles/macos && ./set-defaults.sh
Expand All @@ -69,8 +69,8 @@ cd ~/.dotfiles/macos && ./set-defaults.sh

1. Register the shiny new SSH key that the script generated in appropriate places

- GitHub
- Any necessary servers
- GitHub
- Any necessary servers

2. Install your GPG key:

Expand All @@ -91,13 +91,13 @@ rm private.key

### Organizaztion

Each folder is intended to cover an area of functionality of your computer (as Zach Holman said: topics). As you find new topics of functionality in your computing life you should just toss in a new root directory.
Each folder is intended to cover an area of functionality of your computer (as Zach Holman said: topics). As you find new topics of functionality in your computing life you should just toss in a new root directory.

### Special Topic Files

There are a few special files which exist in the root directory have a few special files.

- **topic/\*.zsh**: Any files ending in `.zsh` get sourced into your environment. (Recommended prefixes: env, path, alias, hook)
- **topic/\*.zsh**: Any files ending in `.zsh` get sourced into your environment. (Recommended prefixes: env, path, alias, hook)
- **topic/\*.symlink**: Any file ending in `*.symlink` gets symlinked into your `$HOME` (with `.symlink` removed).
- **topic/preinstall.sh**: Any file named `preinstall.sh` is executed as part of `bootstrap.sh` but BEFORE brew is invoked.
- **topic/install.sh**: Any file named `install.sh` is executed as part of `bootstrap.sh`.
Expand Down
2 changes: 1 addition & 1 deletion android/path.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
106 changes: 50 additions & 56 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,82 @@
# bootstrap installs things.
set +e

info () {
printf "\r [ \033[00;34m..\033[0m ] $1\n"
info() {
printf "\r [ \033[00;34m..\033[0m ] $1\n"
}

user () {
printf "\r [ \033[0;33m??\033[0m ] $1\n"
user() {
printf "\r [ \033[0;33m??\033[0m ] $1\n"
}

success () {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"
success() {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"
}

fail () {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"
echo ''
exit
fail() {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"
echo ''
exit
}

setup_gitconfig () {
if ! [ -f git/gitconfig.local.symlink ]
then
info 'Setup gitconfig'

git_credential='cache'
if [ "$(uname -s)" == "Darwin" ]
then
git_credential='osxkeychain'
fi

user ' - What is your github author name?'
read -e git_authorname
user ' - What is your github author email?'
read -e git_authoremail
user ' - What is your GPG signing key ID? (Find with: gpg --list-secret-keys --keyid-format LONG)'
read -e git_signingkey

touch git/gitconfig.local.symlink
sed -e "s/AUTHOR_NAME/$git_authorname/g" -e "s/AUTHOR_EMAIL/$git_authoremail/g" -e "s/GIT_CREDENTIAL_HELPER/$git_credential/g" -e "s/GPG_SIGNING_KEY/$git_signingkey/g" git/gitconfig.local.symlink.example > git/gitconfig.local.symlink

success 'gitconfig'
fi
setup_gitconfig() {
if ! [ -f git/gitconfig.local.symlink ]; then
info 'Setup gitconfig'

git_credential='cache'
if [ "$(uname -s)" == "Darwin" ]; then
git_credential='osxkeychain'
fi

user ' - What is your github author name?'
read -e git_authorname
user ' - What is your github author email?'
read -e git_authoremail
user ' - What is your GPG signing key ID? (Find with: gpg --list-secret-keys --keyid-format LONG)'
read -e git_signingkey

touch git/gitconfig.local.symlink
sed -e "s/AUTHOR_NAME/$git_authorname/g" -e "s/AUTHOR_EMAIL/$git_authoremail/g" -e "s/GIT_CREDENTIAL_HELPER/$git_credential/g" -e "s/GPG_SIGNING_KEY/$git_signingkey/g" git/gitconfig.local.symlink.example > git/gitconfig.local.symlink

success 'gitconfig'
fi
}

install_dotfiles () {
info 'Installing dotfiles (symlinks)'
install_dotfiles() {
info 'Installing dotfiles (symlinks)'

local overwrite_all=false backup_all=false skip_all=false
local overwrite_all=false backup_all=false skip_all=false

for src in $(find -H ~/.dotfiles -maxdepth 2 -name '*.symlink' -not -path '*.git*')
do
echo "linking $src"
dst="$HOME/.$(basename "${src%.*}")"
if [ $(readlink $dst) ]
then
rm -fr "$dst"
fi
for src in $(find -H ~/.dotfiles -maxdepth 2 -name '*.symlink' -not -path '*.git*'); do
echo "linking $src"
dst="$HOME/.$(basename "${src%.*}")"
if [ $(readlink $dst) ]; then
rm -fr "$dst"
fi

ln -s "$src" "$dst"
done
ln -s "$src" "$dst"
done
}

setup_clone () {
# Note: This function is not currently called by bootstrap
# Users should manually clone the repo first following the README instructions
cd ~/
git clone $DOTFILES_REPO_URL .dotfiles
cd .dotfiles
setup_clone() {
# Note: This function is not currently called by bootstrap
# Users should manually clone the repo first following the README instructions
cd ~/
git clone $DOTFILES_REPO_URL .dotfiles
cd .dotfiles
}

setup_gitconfig
install_dotfiles

# Run the pre-installers
find . -name preinstall.sh | while read installer ; do sh -c "${installer}" ; done
find . -name preinstall.sh | while read installer; do sh -c "${installer}"; done

# Run Homebrew through the Brewfile
info "› brew bundle"
brew bundle

# find the installers and run them iteratively
find . -name install.sh | while read installer ; do sh -c "${installer}" ; done
find . -name install.sh | while read installer; do sh -c "${installer}"; done

success 'All installed!'


2 changes: 1 addition & 1 deletion docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ minikube addons enable ingress
# Tell Docker CLI to talk to minikube's VM
eval $(minikube docker-env)
# Set up the custom host
echo "`minikube ip` docker.local" | sudo tee -a /etc/hosts > /dev/null
echo "$(minikube ip) docker.local" | sudo tee -a /etc/hosts > /dev/null
10 changes: 5 additions & 5 deletions google/env.zsh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Add Google Cloud

if [[ $(uname -m) == 'arm64' ]]; then
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
else
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
fi
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
fi
2 changes: 1 addition & 1 deletion gpg/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "setting up gpg"
mkdir ~/.gnupg
ln -s ~/.dotfiles/gpg/gpg-agent.conf ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent
gpgconf --kill gpg-agent
15 changes: 7 additions & 8 deletions homebrew/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
# using Homebrew.

# Check for Homebrew
if test ! $(which brew)
then
echo "Installing Homebrew"
if test ! $(which brew); then
echo "Installing Homebrew"

# Install the correct homebrew for each OS type
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> $HOME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install the correct homebrew for each OS type
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> $HOME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi

exit 0
Loading