Cross-platform dotfiles automation using A-frame architecture with DRY principles and nullable safety patterns.
git clone https://github.com/yourusername/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
./installThe installer will detect your OS and prompt for profile selection (workstation/home/server).
- macOS 10.15+ (Intel and Apple Silicon)
- Linux (Ubuntu, Debian, and derivatives)
- Main configuration handles shared logic
- OS-specific modules provide platform customizations
- Shared functions eliminate code duplication
All operations handle missing files, commands, and environment variables gracefully. Scripts continue execution even when optional components fail.
- Shared functions in
scripts/common/shared_functions.sh - Universal package manager interface
- Centralized logging and validation
dotfiles/
├── install # Main installer script
├── install.conf.yaml # Dotbot configuration
├── configs/ # Configuration files
│ ├── shell/
│ │ ├── zsh/ # zsh config
│ │ └── <bash> # bash config
│ ├── editors/
│ │ ├── nvim/
│ │ └── vscode/
│ ├── git/
│ └── terminal/
├── scripts/ # Installation scripts
│ ├── common/ # Shared utilities
│ │ ├── detect_os.sh # Environment detection
│ │ ├── shared_functions.sh # Shared functions
│ │ └── logger.sh # Error logging
│ ├── macos/ # macOS-specific scripts
│ └── linux/ # Linux-specific scripts
└── packages/ # Package definitions
├── macos/
│ ├── Brewfile.home # Brewfile for home use
│ ├── Brewfile.workstation # Brewfile for office workstation
│ └── mas.yaml
└── linux/
├── apt.yaml
└── snap.yaml
Full development environment with GUI applications, development tools, and IDE configurations.
Personal setup with entertainment tools and reduced development focus.
Minimal configuration optimized for headless environments with security tools and system utilities.
The zsh configuration uses A-frame architecture:
~/.zshrc- Main frame with conditional OS loadingzshrc.macos- macOS-specific (Antidote plugin manager)zshrc.linux- Linux-specific (Oh-My-Zsh)
Control behavior through environment variables:
# Package installation
ENABLE_HOMEBREW_INSTALL=true
ENABLE_ESSENTIAL_TOOLS=true
ENABLE_BREWFILE=true
# SSH setup
SSH_KEY_TYPE=ed25519
AUTO_GENERATE_KEY=false
# GUI tools
FORCE_GUI_IN_CONTAINER=falseCreate local customization files that won't be tracked:
~/.zshrc.local- Shell customizations~/.gitconfig.local- Git settingsscripts/.env- Environment variable overrides
- Homebrew for command-line tools
- Homebrew Cask for GUI applications
- Mac App Store via
mas
- APT for system packages
- Snap for GUI applications
- Repository setup for development tools
Package lists are defined in YAML files under packages/ directory.
- Shell: zsh with plugins (Antidote/Oh-My-Zsh)
- Editor: Neovim with configurations
- Terminal: tmux with custom config
- Version Control: Git with sensible defaults
- Languages: Go, Node.js, Python, Ruby
(rbenv), Rust
Automatically configures and starts:
- PostgreSQL
- Redis
- Docker
detect_os.sh- Environment and OS detectionvalidate_installer.sh- Pre-installation validationshared_functions.sh- Common utilities
install_packages.sh- Package installationsetup_*_defaults.sh- OS-specific system configurationsetup_shell.sh- Shell environment configurationsetup_ssh.sh- SSH key and configuration managementsetup_gui_tools.sh- GUI application installation
./install./install --profile server./install --validateFORCE=true ./installmacOS packages - Edit packages/macos/Brewfile.{profile}:
brew "new-package"
cask "new-app"Linux packages - Edit packages/linux/apt.yaml:
development:
- new-package- Place config files in
configs/directory - Add symlink in
install.conf.yaml:
~/.config/newapp/config:
path: configs/newapp/configUse conditionals for platform-specific settings:
~/.config/app/config:
if: '[ "$OS" = "macos" ]'
path: configs/app/config.macos- Run validation:
./install --validate - Check OS support and requirements
- Ensure internet connectivity
- Verify repository access
# Fix SSH permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_*
chmod 644 ~/.ssh/id_*.pub
# Fix Homebrew permissions (macOS)
sudo chown -R $(whoami) /opt/homebrew# Source environment manually
source /tmp/dotfiles_env
# Check detection script output
./scripts/common/detect_os.sh# Update package managers
brew update # macOS
sudo apt update # Linux
# Clear package caches
brew cleanup # macOS
sudo apt autoclean # Linux- Idempotent - Safe to run multiple times
- Non-destructive - Won't overwrite existing configurations without confirmation
- Rollback capable - Git-based tracking of changes
- Validation - Pre-installation environment checks
- Graceful degradation - Continues even when components fail
- Follow A-frame architecture principles
- Use nullable safety patterns
- Test on both macOS and Linux
- Update documentation for new features
- Maintain DRY principles
MIT License - see LICENSE file for details.