Skip to content

About

🔧 .files, including ~/.macos — sensible hacker defaults for macOS

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Mark's Dotfiles

Reproducible dotfiles using Nix, devenv, and home-manager.

New Machine Setup (Complete Guide)

Step 1: Install Xcode Command Line Tools

xcode-select --install

Click "Install" in the dialog. Wait ~5-10 minutes.

Step 2: Generate SSH Key & Add to GitHub

# Generate SSH key
ssh-keygen -t ed25519 -C "testdepth@users.noreply.github.com"

# Start ssh-agent and add key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Copy public key to clipboard
pbcopy < ~/.ssh/id_ed25519.pub

Add key at https://github.com/settings/keys, then verify:

ssh -T git@github.com

Step 3: Install Nix

Install Nix via the recommended multi-user installation. Open a Terminal (by pressing [Cmd] + [Space] and typing terminal) and run the following command:

sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)

Restart terminal after installation.

Step 4: Enable Flakes

mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf

Step 5: Clone dotfiles

git clone git@github.com:testdepth/dotfiles.git ~/.dotfiles
cd ~/.dotfiles

Step 6: Apply configuration (installs direnv)

Home Manager installs direnv, nix-direnv, and the Fish hook (programs.direnv in modules/shell/fish.nix). Do not also install direnv with nix profile install; remove any existing profile copy first: nix profile remove direnv.

apply

Or: nix run home-manager -- switch --flake .#macbook

Then trust this repo’s .envrc:

direnv allow

Wait for devenv to build (~2–5 min first time).

Step 7: Set Fish as Default Shell

echo $(which fish) | sudo tee -a /etc/shells
chsh -s $(which fish)

Restart terminal to use fish.

Step 8: Install Ghostty

Download from https://ghostty.org/download or:

brew install --cask ghostty

Step 9: Initialize Neovim

LazyVim config is installed automatically via apply. Just run neovim to install plugins:

nvim  # Wait for plugins to install, then :q

Step 10: Install Claude Code (Optional)

npm install -g @anthropic-ai/claude-code

Quick Reference

Step Command Time
Xcode tools xcode-select --install 5-10 min
SSH key ssh-keygen -t ed25519 1 min
Nix curl ... | sh 2-3 min
Enable flakes echo ... > ~/.config/nix/nix.conf 10 sec
Clone git clone ... ~/.dotfiles 1 min
Apply + direnv apply then direnv allow 2-5 min
Fish shell chsh -s $(which fish) 10 sec
Ghostty Download/brew 1 min
Neovim nvim (plugins auto-install) 1 min

Total: ~20-30 minutes


Existing Machine Update

cd ~/.dotfiles
nix flake update   # Update dependencies
apply              # Full home-manager switch
apply-nvim         # Same as apply (shorthand when you only changed config/nvim/)

apply-nvim is on your PATH after a successful apply. Home Manager cannot activate only Neovim; both commands run a full profile switch.

Structure

~/.dotfiles/
├── flake.nix              # Nix flake entry point
├── flake.lock             # Locked dependencies
├── devenv.nix             # Development shell
├── home.nix               # Base home-manager config
├── .envrc                 # direnv configuration
│
├── modules/               # Modular configurations
│   ├── shell/fish.nix     # Fish shell + bobthefish prompt
│   ├── terminal/ghostty.nix  # Ghostty terminal
│   └── git/default.nix    # Git configuration
│
├── config/                # Application configs (symlinked via home-manager)
│   └── nvim/              # Neovim (LazyVim)
│
├── hosts/                 # Machine-specific configs
│   └── macbook/           # macOS configuration
│
├── scripts/               # Helper scripts
│   └── bootstrap.sh       # New machine setup
│
├── .claude/               # Claude Code settings
│   └── CLAUDE.md          # AI assistant instructions
│
└── AGENTS.md              # AI coding guidelines

Adding New Dotfiles

To add a new config that gets symlinked automatically via apply:

1. For files in ~/.config/ (XDG config directory):

# In home.nix
xdg.configFile."app/config.toml" = {
  source = ./config/app/config.toml;
  # Use recursive = true for directories
};

2. For files in ~/ (home directory):

# In home.nix
home.file = {
  ".somerc".source = ./.somerc;
  ".config-dir" = {
    source = ./config-dir;
    recursive = true;
  };
};

3. Add to git and apply:

git add <new-files>
apply

Workflow: Claude Code + Neovim + Ghostty

This setup is optimized for the Claude Code + Neovim workflow.

3-Pane Layout

+------------------+------------------+
|                  |                  |
|   Claude Code    |     Neovim       |
|                  |                  |
|                  +------------------+
|                  |      Shell       |
+------------------+------------------+

Ghostty Keybindings

  • Cmd+D - Split right (for Neovim)
  • Cmd+Shift+T - Split down (for shell)
  • Ctrl+H/J/K/L - Navigate between panes (vim-style)
  • Cmd+W - Close pane

Setup

  1. Open Ghostty
  2. Cmd+D to create right pane
  3. Cmd+Shift+T to create bottom pane
  4. Run claude in left pane
  5. Open files with nvim in right pane

Neovim

Uses LazyVim starter. Config is in config/nvim/ and symlinked via home-manager.

Configurations

Configuration Description
macbook macOS Apple Silicon
macbook-intel macOS Intel
shark macOS Apple Silicon (shark)
linux Linux x86_64

Commands

Available in the devenv shell:

apply   # Apply home-manager configuration
update  # Update flake inputs
fmt     # Format Nix files

Requirements

Credits

About

🔧 .files, including ~/.macos — sensible hacker defaults for macOS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages