This repository contains dotfiles and scripts that I use to customise my macOS/Linux development workflow. Feel free to use this as a reference for your own setup.
- Overview
- Features
- Installation
- System Requirements
- Architecture
- Key Components
- Development Environment
- Common Commands
- Configurations
- Feedback
- Licence
This is a personal dotfiles repository for macOS/Linux development environment setup. The repository contains shell configurations, aliases, automated setup scripts, and Homebrew package management for a consistent development environment across machines.
- Automated Setup: Complete development environment setup with a single command
- Interactive Installation: Customisable setup with profile selection and dry-run mode
- Shell Configuration: Oh-My-Zsh with Starship prompt and syntax highlighting
- Package Management: Homebrew Brewfile for consistent package installation with profile support (minimal/developer/full)
- Git Integration: Comprehensive git aliases and configuration
- Node.js Management:
fnmfor Node.js version management - Development Tools: VSCode, cloud tools, databases, and utilities
- Touch ID for Sudo: Enable Touch ID authentication for sudo commands (macOS only)
- Scheduled Maintenance: Automated Homebrew and pnpm maintenance via crontab
- Docker Testing: Test setup scripts in isolated environment
- Cross-platform: Support for macOS and Linux
- macOS (10.15+)
- Linux (Ubuntu 20.04+, Fedora 33+)
- Zsh
- Git
- curl
- Library Functions (
lib/): Shared utility libraries for platform detection, interactive prompts, backup management, and profile selection - Shell Scripts (
shell/): Modular setup scripts for different components (aliases, zsh, vim, Claude Code, crontab, Touch ID for sudo) - Setup Scripts (
setup/): Core installation scripts (Homebrew installation) - Configuration Files (
config/): Symlinked dotfiles (.zshrc,.aliases,.vimrc) and settings (.claude/settings.json,crontab) - Scripts (
scripts/): Utility scripts (Node.js symlink management) - Testing: Docker-based testing infrastructure (
test-setup.sh,docker-compose.yml,Dockerfile,TESTING.md) - Brewfile: Homebrew package manifest with profile support (minimal, developer, full)
The setup.sh script provides both interactive and automated setup:
Interactive mode (default):
- Dry-run mode with
--dry-runflag to preview changes - Profile selection: minimal (~15 packages), developer (~40-50 packages), or full (~120 packages)
- Backup handling for existing dotfiles
- Crontab configuration for scheduled maintenance
- Node.js version manager selection (fnm/nvm/both)
- Python version selection (full profile only)
- Database installation options (developer/full profiles)
Non-interactive mode (--no-interactive):
- Uses default settings (full profile)
- Specify profile via
--profile=minimal|developer|full
Installation sequence:
- Collects user preferences (interactive mode only)
- Makes all
.shscripts executable - Runs scripts in
setup/directory (Homebrew installation) - Runs scripts in
shell/directory (dotfile symlinking, crontab configuration) - Installs Homebrew packages via
brew bundle install(using selected profile)
- Zsh: Oh-My-Zsh with syntax highlighting plugin
- Theme: Starship prompt
- Node: Uses
fnmfor Node.js version management - Environment: Configured for development with PostgreSQL, Python, Android SDK
- Development: git, gh, nvm, pnpm, yarn, bun
- Cloud: vercel-cli, aws-sam-cli, pulumi, doctl
- Databases: postgresql@17, redis
- Utilities: jq, ripgrep, httpie, direnv
- VSCode: With comprehensive extension set
NEXT_TELEMETRY_DISABLED=1: Disables Next.js telemetryPNPM_HOME: pnpm global package directory- PostgreSQL and Android SDK paths configured
# Install all Homebrew packages
brew bundle install
# Update Brewfile
brew bundle dump --force# Reload zsh configuration
zshreload # alias for 'source $HOME/.zshrc'
# Edit zsh configuration
zshconfig # alias for 'vi $HOME/.zshrc'# View current cron jobs
crontab -l
# Apply dotfiles crontab configuration
crontab $HOME/dotfiles/config/crontab
# View maintenance logs
tail -f /tmp/brew-weekly.log # Weekly Homebrew updates (Sunday 2 AM)
tail -f /tmp/brew-cleanup.log # Monthly cleanup (1st of month, 3:30 AM)
tail -f /tmp/brew-health.log # Quarterly health checks (Jan/Apr/Jul/Oct, 4 AM)
tail -f /tmp/pnpm-cleanup.log # Weekly pnpm store pruning (Monday 3 AM)# Test setup script with Docker (dry-run mode)
./test-setup.sh
# Test specific profile
./test-setup.sh minimal
./test-setup.sh developer
./test-setup.sh full
# Test all scenarios
./test-setup.sh all
# Interactive debugging
./test-setup.sh shell
# Clean up test containers
./test-setup.sh cleanFor more details, see TESTING.md
# Setup Touch ID for sudo commands
sudo zsh shell/sudo-touch-id/setup.sh
# Verify Touch ID configuration
zsh shell/sudo-touch-id/verify.sh
# Restore original PAM configuration
sudo zsh shell/sudo-touch-id/restore.sh- Oh-My-Zsh: Custom configuration with Starship theme
- Key plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- git
- docker
User-level Claude Code settings are backed up and version-controlled:
- Location:
config/.claude/settings.json - Symlinked to:
~/.claude/settings.json - Setup: Automatically configured during
setup.shexecution - Manual restore: Run
source $HOME/dotfiles/shell/claude.shto restore the symlink
Enable Touch ID authentication for sudo commands:
- Setup: Modifies PAM configuration to enable Touch ID
- Security: Uses
/etc/pam.d/sudo_local(survives macOS updates) - Requirements: macOS 10.15 (Catalina) or later
- Features:
- Interactive warning before making system changes
- Verification script to test configuration
- Restore script to revert to original configuration
- Version checks to ensure compatibility
g→gitgs→git statusgcm→git checkout mainglog→ formatted git log with graphgp→git pullgps→git push- Full list available in
.aliasesfile
Warning: Do not blindly use these settings as they may override or modify your existing configuration. It is highly recommended to clone/fork this repository to another folder. Use at your own risk!
The interactive setup guides you through customising your installation:
# Clone the repository
git clone https://github.com/ruchernchong/dotfiles.git $HOME/dotfiles
cd $HOME/dotfiles
# Preview what would be installed (dry-run mode)
./setup.sh --dry-run
# Run the interactive setup
./setup.shThe interactive setup allows you to:
- Choose installation profile (minimal/developer/full)
- minimal: Essential tools only (~15 packages)
- developer: Development environment (~40-50 packages)
- full: Complete installation (~120 packages)
- Select Node.js version manager (fnm/nvm/both)
- Choose Python version (3.13/3.12/3.11/all) - full profile only
- Configure backup options for existing files
- Customise database installations (PostgreSQL, Redis) - developer/full profiles
- Configure scheduled maintenance tasks (crontab)
- Preview changes before applying
curl -L https://raw.githubusercontent.com/ruchernchong/dotfiles/master/install.sh | bash# Clone and setup
git clone https://github.com/ruchernchong/dotfiles.git $HOME/dotfiles
cd $HOME/dotfiles
chmod a+x setup.sh
source setup.shI welcome any feedback or suggestions by creating an issue or a pull request.
This code is available under the MIT Licence
