Skip to content

Instantly share code, notes, and snippets.

@axelhamil
Last active August 5, 2025 14:35
Show Gist options
  • Select an option

  • Save axelhamil/42ae9a5f4332a2550942848675a84d1b to your computer and use it in GitHub Desktop.

Select an option

Save axelhamil/42ae9a5f4332a2550942848675a84d1b to your computer and use it in GitHub Desktop.
MacOS config from scratch

⚙️ macOS Dev Environment Setup

A clean and pragmatic guide to setting up a modern development environment on macOS, including:

  • 🧃 Homebrew
  • 🐱 Kitty terminal
  • 🔐 Git + GitHub over SSH with signed commits
  • 🧩 Dotfiles management using GNU Stow

🍺 Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then add Homebrew to your shell:

echo >> /Users/{USERNAME}/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/{USERNAME}/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Replace {USERNAME} with your macOS user name.


🐱 Install Kitty Terminal

brew install kitty

Kitty's config file is located at:

~/.config/kitty/kitty.conf

🔠 Install Nerd Font

  1. Visit nerdfonts.com/font-downloads
  2. Download a font and install it (double-click the .ttf files)

Then, set it in your Kitty config:

font_family Your Nerd Font Name

🔐 Configure Git & GitHub with SSH and Signed Commits

Install Git

brew install git
git --version

Generate Your SSH Key

ssh-keygen -t ed25519 -C "your@email.com" -f ~/.ssh/id_github

Add the key to the SSH agent:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_github

Configure your SSH client:

vim ~/.ssh/config

Paste this:

Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_github
  IdentitiesOnly yes

Add Your Key to GitHub

Display your public key:

cat ~/.ssh/id_github.pub

Copy it and add it to:
👉 GitHub → Settings → SSH and GPG keys

Use the same key again as a "Signing Key" later.


Test the SSH Connection

ssh -T git@github.com

Expected output:

Hi {your_username}! You've successfully authenticated, but GitHub does not provide shell access.

🗂️ Set Up Dotfiles and Git Signing with SSH

Install GNU Stow and Create Your Dotfiles Structure

brew install stow

mkdir -p ~/dotfiles/git
cd ~/dotfiles
git init
cd ~/dotfiles/git
touch .gitconfig

Optional modular structure (recommended):

mkdir -p ~/dotfiles/{git,zsh,nvim,kitty}

Git Config with Signed Commits

In ~/dotfiles/git/.gitconfig:

[user]
  name = Your Name
  email = your@email.com
  signingkey = ~/.ssh/id_github

[commit]
  gpgsign = true

[gpg]
  format = ssh

[gpg "ssh"]
  allowedSignersFile = ~/.ssh/allowed_signers

Create the Allowed Signers File

Get your public key:

cat ~/.ssh/id_github.pub

Create the file:

echo "your@email.com ssh-ed25519 your_public_key" > ~/.ssh/allowed_signers
chmod 600 ~/.ssh/allowed_signers

Add the Signing Key on GitHub

Go to:
👉 GitHub → Settings → SSH and GPG keys
Choose "Signing key" and paste the same public key.


Apply Dotfiles with stow

cd ~/dotfiles
stow git

Check the symlink:

ls -la $HOME
# You should see: .gitconfig -> ~/dotfiles/git/.gitconfig

Make a commit:

cd ~/dotfiles
git add .
git commit -m "Init dotfiles with Git config"

Then verify it's signed:

git log -1 --show-signature

If properly configured, GitHub will show a ✅ Verified badge next to your commits.


✅ You're All Set!

Your macOS dev environment is now:

  • Minimal
  • Portable
  • Secure
  • Craft-friendly

You can extend this setup with more stow modules (zsh, neovim, etc.) and version your full environment in Git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment