Skip to content

codingnirvana/mac-setup-script

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Developer Setup Guide

A comprehensive setup script for new MacBooks optimized for developers, based on real-world usage patterns and 2025 best practices.

🚀 Quick Start

# Download and run the setup script
curl -fsSL https://raw.githubusercontent.com/your-username/mac-setup/main/mac-setup.sh | bash

# Or run locally
chmod +x mac-setup.sh
./mac-setup.sh

📦 What's Included

Essential Development Tools

  • Languages: Python 3.12/3.11, Node.js (LTS), Ruby, Rust, Go
  • Version Control: Git with optimized config, GitHub CLI
  • Databases: PostgreSQL, SQLite, Redis
  • DevOps: Docker, Terraform, AWS CLI, kubectl
  • Modern CLI: ripgrep, fzf, bat, eza, fd, zoxide

GUI Applications

  • Editors: VS Code, Cursor (AI-powered)
  • Browsers: Chrome, Firefox, Arc
  • Communication: Slack, Discord, Telegram, Zoom
  • Productivity: Alfred, Rectangle, Dropbox
  • Development: iTerm2, Docker Desktop, Postman

Shell Environment

  • Zsh with Oh My Zsh
  • Powerlevel10k theme for beautiful prompts
  • Optimized startup time (~0.3 seconds)
  • Enhanced history (50K commands, smart deduplication)
  • Useful plugins: autosuggestions, syntax highlighting

🎯 Key Features

Performance Optimized

  • Fast shell startup with lazy loading
  • Smart completion caching (checks only once/day)
  • Minimal plugin loading for speed

Developer-Friendly macOS Defaults

  • Show hidden files in Finder
  • Enhanced Finder with path bar and status
  • Faster key repeat rates
  • Optimized Dock settings
  • Screenshot location and format optimization

Modern Git Configuration

  • Rebase by default for cleaner history
  • Enhanced conflict resolution with zdiff3
  • Useful aliases for common operations
  • Branch sorting by commit date
  • Auto-pruning of remote branches

Secure Defaults

  • Password-protected screensaver
  • Secure SSH directory permissions
  • GPG support for commit signing

📁 Directory Structure

~/Development/
├── Projects/
│   ├── Web/
│   ├── Mobile/
│   ├── Backend/
│   └── Scripts/
├── Playground/
└── Archive/

🛠 Manual Steps After Setup

1. Configure Git Identity

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

2. Setup SSH Keys

ssh-keygen -t ed25519 -C "your.email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

3. Configure Powerlevel10k

p10k configure

4. Install Mac App Store Apps

mas install 497799835  # Xcode
mas install 1333542190 # 1Password

🔧 Using Brewfile

Alternative installation using Homebrew Bundle:

# Install from Brewfile
brew bundle --file=Brewfile

# Generate Brewfile from current system
brew bundle dump --file=Brewfile

🎨 Customization

Add Your Own Packages

Edit the arrays in mac-setup.sh:

  • essential_formulas[] for CLI tools
  • essential_casks[] for GUI apps

Custom macOS Defaults

Add your preferences to the optimize_macos_defaults() function.

Shell Aliases

Customize aliases in the .zshrc creation section.

🔍 What's Different from Other Scripts

  1. Based on Real Usage: Analyzed actual installed packages and usage patterns
  2. Performance First: Optimized for fast shell startup and responsiveness
  3. 2025 Ready: Uses modern tools and current best practices
  4. India-Friendly: Date formats and regional considerations
  5. Modular Design: Easy to customize and extend
  6. Well Documented: Clear explanations for each choice

📊 Performance Benchmarks

  • Shell startup: ~0.33 seconds (vs 5+ seconds typical)
  • Git operations: Faster with smart caching and pruning
  • Package installation: Parallel where possible

🛡 Security Considerations

  • Minimal sudo usage: Only when necessary
  • Secure defaults: Password protection, encrypted storage
  • Code signing: Ready for GPG commit signing
  • Permission management: Proper file permissions

🤝 Contributing

  1. Fork the repository
  2. Add your improvements
  3. Test on a fresh Mac
  4. Submit a pull request

📝 License

MIT License - Feel free to use and modify for your needs.


Note: This script is based on analysis of a real developer's Mac setup with 15+ years of accumulated tools and optimizations. It prioritizes performance, security, and developer productivity.

About

script to setup my mac

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Shell 91.3%
  • Ruby 8.7%