Skip to content

l2D/dotfiles_public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My macOS Dotfiles

This repository contains my personal dotfiles for setting up a new macOS device. It includes a Brewfile with 100+ command-line tools and applications that I use for development, DevOps, and general productivity.

🚀 Installation

Remote Installation (Bootstrap)

To set up a new device, run the following command in your terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/l2D/dotfiles_public/main/install.sh)"

This will clone the repository to a temporary directory and execute the setup script.

Local Installation

If you've already cloned the repository:

# Clone the repository (if not already cloned)
git clone https://github.com/l2D/dotfiles_public.git ~/.dotfiles
cd ~/.dotfiles

# Run installer directly
bash install.sh

# Or use make
make install

Note: During installation, you'll be prompted to:

  • Configure your macOS Dock with preferred applications (optional)
  • Delete the cloned repository after installation (optional)

Prerequisites

  • Xcode Command Line Tools: The installer will prompt for installation if not present
  • macOS: This setup is designed specifically for macOS (Intel and Apple Silicon)

🧐 How It Works

The installation script (install.sh) is a self-contained installer that performs the following steps:

  1. Clones the Repository: It clones this repository to a temporary ~/.dotfiles directory on your local machine.
  2. Installs macOS Prerequisites:
    • Xcode Command Line Tools: Prompts for installation if not already present.
    • Rosetta 2: Installs it on Apple Silicon Macs if needed.
  3. Installs Homebrew: If not already installed, it will install Homebrew.
  4. Copies Dotfiles: It copies all the necessary configuration files (.vimrc, .p10k.zsh, .zshrc, .zprofile, Brewfile, and .config files) to your home directory.
  5. Configures Homebrew: It adds the Homebrew environment to your shell's .zprofile.
  6. Installs Packages: It installs all the packages, casks, and applications listed in the Brewfile using brew bundle --global.
  7. Dock Configuration (Optional): Prompts to configure your macOS Dock with preferred applications using scripts/configure-dock.sh.
  8. Cleanup (Optional): Prompts to remove the temporary ~/.dotfiles directory after installation.

Interactive Prompts:

  • You can skip optional steps (Dock configuration, cleanup) by responding with 'n' or 'no'
  • The installation will continue successfully even if optional steps are skipped or fail

🛠️ Makefile Commands

The repository includes a Makefile with convenient commands for common tasks:

Command Description
make help Display all available commands
make install Run the full dotfiles installation
make dock-preview Preview Dock configuration changes (dry-run)
make dock-apply Apply Dock configuration
make dock-restore Restore Dock to macOS defaults
make test Run all tests
make test-unit Run unit tests for install.sh
make test-brewfile Validate Brewfile syntax
make test-zsh Syntax check zsh configuration
make clean Remove temporary installation directory

Usage Examples:

# Display available commands
make help

# Run full installation
make install

# Preview what Dock configuration would do
make dock-preview

# Apply Dock configuration
make dock-apply

# Restore Dock to macOS defaults
make dock-restore

# Run all tests
make test

# Validate Brewfile syntax (requires ~/.Brewfile)
make test-brewfile

# Clean up temporary files
make clean

📦 What's Included?

This repository installs 100+ packages organized by category:

☁️ Cloud Providers CLI

  • aws-sso-cli: Securely manage AWS API credentials using AWS SSO
  • aws-vault: Secure, cross-platform tool for managing AWS credentials
  • awscli: Official Amazon AWS command-line interface
  • azure-cli: Command-line tools for Azure
  • gcloud-cli: Google Cloud SDK command-line interface

🐳 Container & Kubernetes

  • helm: The Kubernetes package manager
  • istioctl: Istio configuration command-line utility
  • k9s: Kubernetes CLI to manage clusters in style
  • kind: Kubernetes in Docker - local clusters for testing
  • kompose: Tool to move from docker-compose to Kubernetes
  • kubectx: Switch between kubectl contexts easily
  • kubernetes-cli: Kubernetes command-line interface
  • kustomize: Customization of Kubernetes YAML configurations

🏭 Infrastructure as Code

  • terraform: Infrastructure as code software tool
  • infracost: Cloud cost estimates for Terraform
  • terraform-docs: Generate documentation from Terraform modules
  • terragrunt: Thin wrapper for Terraform providing extra tools

🔄 DevOps & CI/CD

  • act: Run your GitHub Actions locally
  • argocd: GitOps Continuous Delivery for Kubernetes
  • bk@3: Buildkite CLI
  • helmfile: Deploy Kubernetes Helm Charts

🔐 Security & Secrets Management

  • dependency-check: OWASP dependency-check
  • gnupg: GNU Pretty Good Privacy (PGP) package
  • vault: Tool for securely accessing secrets
  • infisical: Open source secrets management platform
  • mkcert: Make locally-trusted development certificates
  • nss: Libraries for security-enabled applications
  • pre-commit: Framework for managing multi-language pre-commit hooks
  • trivy: Vulnerability scanner for containers and IaC

👩‍💻 Programming Languages & Runtimes

🔄 Version Managers

  • mise: Polyglot tool version manager
  • pyenv: Python version management
  • nvm: Manage multiple Node.js versions

📦 Package Managers

  • pnpm: Fast, disk space efficient package manager
  • yarn: Fast, reliable dependency management

🌱 Git & Version Control

  • gh: GitHub command-line tool
  • git: Distributed revision control system
  • git-lfs: Git extension for versioning large files

✏️ Development Tools & Editors

  • vim: Vi 'workalike' with many additional features
  • neovim: Ambitious Vim-fork focused on extensibility
  • watchman: Watch files and take action when they change

🧪 Testing & Performance

  • bats-core: Bash Automated Testing System
  • k6: Modern load testing tool

🌐 Networking & HTTP

  • dog: Command-line DNS client
  • httpie: User-friendly cURL replacement
  • wget: Internet file retriever

📡 CLI Utilities

  • asciinema: Record and share terminal sessions
  • bat: Cat clone with syntax highlighting
  • dockutil: Tool for managing macOS Dock items
  • exa: Modern replacement for 'ls'
  • fd: Simple, fast alternative to 'find'
  • fzf: Command-line fuzzy finder
  • htop: Improved top (interactive process viewer)
  • jd: JSON diff and patch utility
  • jq: Lightweight command-line JSON processor
  • mas: Mac App Store command-line interface
  • navi: Interactive cheatsheet tool
  • ripgrep: Search tool like grep
  • tldr: Simplified and community-driven man pages
  • tokei: Count code quickly
  • tree: Display directories as trees
  • tz: CLI time zone visualizer
  • yq: Process YAML documents from the CLI

📚 System Libraries

  • gnutls: GNU Transport Layer Security (TLS) Library
  • libyaml: YAML C library
  • openssl@3: Cryptography and SSL/TLS Toolkit

💻 GUI Applications

Browsers

  • arc: Web browser

Terminal

  • warp: Modern, Rust-based terminal with AI

Productivity

Development

Fonts

🏪 Mac App Store Apps

🧪 Testing

This repository includes a comprehensive test suite using BATS (Bash Automated Testing System) to verify the installation script's behavior.

Prerequisites

Install BATS via Homebrew:

brew install bats-core

Running Tests

Using Make (Recommended):

# Run all tests
make test

# Run unit tests for install.sh
make test-unit

# Validate Brewfile syntax (requires ~/.Brewfile)
make test-brewfile

# Syntax check zsh configuration (requires ~/.zshrc)
make test-zsh

Direct Execution:

# Run all tests
bats tests/install.bats

# Run specific tests matching a pattern
bats tests/install.bats -f "Dock configuration"

# Run with verbose output
bats tests/install.bats --print-output-on-failure

Test Coverage

The test suite covers:

  1. Dock Configuration Tests

    • User accepts/declines Dock configuration
    • Case-insensitive responses (y/yes/Y/YES, n/no/N/NO)
    • Invalid input handling
    • Dry-run mode
  2. Installation Resilience

    • Installation continues even if Dock configuration fails
    • Error handling for missing prerequisites
  3. Repository Cleanup Tests

    • User accepts/declines repository deletion
    • Case-insensitive responses
    • Repository retention on invalid input
  4. File Operations

    • Dotfiles copied correctly to home directory
    • Directory structure preserved

Test Files

  • tests/install.bats: Main BATS test suite with 21 test cases
  • tests/README.md: Detailed testing documentation

For more information about the test suite, see tests/README.md.

🔧 Helper Scripts

Dock Configuration

The scripts/configure-dock.sh script automates the configuration of your macOS Dock by removing unwanted apps and adding/ordering your preferred applications.

Usage:

# Preview changes without applying them (dry-run)
./scripts/configure-dock.sh --dry-run
# Or using make
make dock-preview

# Apply dock configuration
./scripts/configure-dock.sh
# Or using make
make dock-apply

Prerequisites:

  • dockutil (automatically installed via Brewfile)

What it does:

  • Removes default macOS apps you don't use (Safari, Mail, Maps, Photos, FaceTime, etc.)
  • Adds and orders your preferred applications (Arc, Warp, GitKraken, Docker, Slack, etc.)
  • Restarts the Dock to apply changes

Note: The install.sh script will offer to run Dock configuration automatically during installation.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributors