Personal dotfiles for macOS development setup.
~/Code/personal/dotfiles/
├── config/ # Synced to $HOME (dotfiles, .config/)
├── macos/
│ └── settings.sh # macOS system preferences (requires sudo)
├── sandbox/
│ ├── Dockerfile # Sandbox image
│ └── entrypoint.sh # Sandbox entry point
├── shell/
│ ├── .aliases # Shell aliases
│ ├── .zshenv # Zsh environment
│ ├── .zprofile # Zsh profile
│ └── .zshrc # Zsh config
├── vscode/
│ ├── settings.json # VSCode settings
│ ├── keybindings.json # VSCode keybindings
│ └── extensions.json # VSCode extensions list
├── dotfiles.sh # Main setup script
└── sandbox.sh # Run commands in sandbox container
- Enable "Full Disk Access" for Terminal (System Settings -> Privacy & Security -> Full Disk Access).
- Clone this repo to the expected location (or update
CODE_DIRandDOTFILES_DIRindotfiles.shandsandbox.sh).
mkdir -p ~/Code/personal
git clone https://github.com/urban/dotfiles.git ~/Code/personal/dotfiles- Run the dotfiles script:
cd /Volumes/Code/personal/dotfiles
./dotfiles.sh initOnce setup, follow the instructions on Generating a new SSH key and adding it to the ssh-agent and Adding a new SSH key to your GitHub account to gain access to your private GitHub repositories.
Then change the dotfiles repo remote from HTTPS to SSH.
cd /Volumes/Code/personal/dotfiles
git remote set-url origin git@github.com:urban/dotfiles.gitdotfiles.sh handles initialization for a new machine.
./dotfiles.sh --help
./dotfiles.sh init
./dotfiles.sh updateWhat it does:
- If
/Volumes/Codeis missing, adds it to Spotlight exclusions and restartsmds - Symlinks
home/into$HOMEvia GNU Stow (with optional backups of conflicting files) - Symlinks VSCode settings, keybindings, and extensions list into
~/Library/Application Support/Code/Uservia GNU Stow (with optional backups) - Installs Xcode Command Line Tools if missing
- Installs Homebrew if missing and ensures
brew shellenvis in~/.zprofile - Installs packages from the Brewfile via
brew bundle install - Installs Nix if missing via the
nixos.orginstall script
sandbox.sh handles running a command inside a Docker-based sandbox (requires Docker):
./sandbox.sh bash
./sandbox.sh node -vWhat it does:
- Validates paths, creates a per-project
.sandboxstate directory, and ensures it is in.gitignore - Captures Git author info and creates state dirs for bun, pnpm, gh, and codex
- Creates a persistent
sandbox-nix-storeDocker volume for the Nix store - Builds the sandbox image from
sandbox/Dockerfile - Runs an interactive container mounting the project, state dirs, and Nix store, and passes Git author env vars
- Entry point installs Nix/tools, installs latest npm and
@openai/codex, prompts for Codex/GitHub auth if missing, configures git, runsdirenv allow, then runs the provided command (or starts/bin/bashif none was given)