Personal macOS development environment configuration and setup automation.
This repository contains my dotfiles and configuration files for a reproducible development environment. It uses GNU Stow for symlink management and Homebrew for package management.
- zsh: Shell configuration and customizations
- git: Git configuration and aliases
- config: Application-specific configurations
- kube: Kubernetes-related configurations, encrypted with sops
- Brewfile: Declarative package management for all installed tools
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"# Clone repo
git clone https://github.com/alexandrbyzov/dotfiles.git ~/dotfiles
cd ~/dotfiles
# Install package from Brewfile
brew bundle --file ~/dotfiles/Brewfilestow zsh git configInstall packages from Brewfile:
brew bundle --file ~/dotfiles/BrewfileUpdate Brewfile with currently installed packages:
brew bundle dump --file ~/dotfiles/Brewfile --forceThe dotfiles directory is the source of truth. Stow creates symlinks from this repo to your $HOME directory.
# Add new dotfiles
stow <directory-name>
# Remove symlinks
stow -D <directory-name>
# Restow (useful after changes)
stow -R <directory-name>Configure multiple GitHub accounts by setting up separate SSH hosts in ~/.ssh/config:
Host github.com
HostName github.com
User git
IdentityFile path-to-identity-file
IdentitiesOnly yes
AddKeysToAgent yes
UseKeychain yesConfiguration options:
IdentitiesOnly yes- Prevents SSH from trying all keys (improves security & performance)AddKeysToAgent yes- Caches passphrase in SSH agentUseKeychain yes- (macOS) Stores passphrase in system keychain
Usage:
git clone git@github.com:username/repo.gitFor sensitive data like age keys, SSH keys, or API tokens, store them securely in macOS Keychain instead of plain files.
# Store from file
security add-generic-password -s "secret-name" -a "$USER" -w "$(cat /path/to/secret)"
# Store from clipboard
security add-generic-password -s "secret-name" -a "$USER" -w "$(pbpaste)"
# Add -U flag to sync via iCloud Keychain (optional)
security add-generic-password -s "secret-name" -a "$USER" -w "$(cat /path/to/secret)" -U# Print to stdout
security find-generic-password -s "secret-name" -w
# Print to stdout multi-line secret (they are usually Hex-encoded)
security find-generic-password -s "secret-name" -w | xxd -r -p
# Write to file
security find-generic-password -s "secret-name" -w > /path/to/secretFor a smoother typing experience in editors like VS Code:
defaults write -g ApplePressAndHoldEnabled -bool falseRestart your applications for the change to take effect.