How ryuheechul/dotfiles works
Project Type and Purpose
• This is neither a web app nor a compiler but an “infrastructure‑as‑code” or dotfiles repository.
• Purpose: centrally manage and bootstrap a developer workstation (macOS, Linux, NixOS) by versioning all shell configs, editor configs, package definitions, keybindings, and bootstrap scripts.
High-Level Architectural Components
• Dotfiles Git Repository
• Holds all configuration, scripts, and package definitions.
• Bootstrap Foundation Scripts
• Platform‑specific folders (bootstrap/foundation/{darwin,linux,nixos}) → install package managers, symlink configs.
• Configuration Script
• bootstrap/configuration.sh → orchestrates installation of common tools.
• Package Managers & Package Definitions
• Nix (nix/, home-manager, nixos modules)
• Homebrew (brew/Brewfile, dep.Brewfile)
• asdf (asdf/tool-versions)
• Shell Configuration
• Zsh (zsh/, zshrc.d/)
• Starship prompt (starship.toml)
• Aliases (aliases/)
• Shell‑level utilities and integrations
• Editor Configurations
• Neovim (nvim/)
• Vim/SpaceVim (SpaceVim.d/)
• Emacs (emacs.d/)
• Snippets, plugin managers, language servers
• Terminal & UI Tools
• Alacritty (alacritty/)
• tmux configuration (tmux.conf), Zellij (zellij/)
• Hyper.js, lf, bat, gh, ghostty, espanso
• OS‑level Integrations & Keybindings
• Karabiner (karabiner/) for macOS
• AutoHotkey (autohotkey/) for Windows via WSL
• Custom Binaries & Utilities
• bin/ (helper scripts used by various stages)
• setup.sh entrypoint
Relationships and Data Flow
• Developer runs setup.sh or directly invokes bootstrap scripts
→ Scripts read configuration files in the repo
→ Install or configure package managers (Nix, Homebrew, asdf)
→ Use package managers to install tools/packages (via brew/Brewfile, nix/*, asdf/tool-versions)
→ Symlink dotfiles into home directory (zsh, editor, terminal configs)
• At runtime, user shells (Zsh) source zshrc.d/ and modules
→ Load aliases, path adjustments, plugin integrations (fzf, git, tmux)
• When launching an editor, its plugin manager (lazy.nvim, Doom Emacs, SpaceVim) loads from respective config directories
• OS‑level keybinding tools (Karabiner, AutoHotkey) load JSON configs to remap keys
Key Architectural Patterns
• Modular directory structure per tool/service
• “Bootstrapping” pattern: sequence of scripts that bring a clean machine to a fully configured dev workstation
• Layered package management: OS package manager (Homebrew/Nix), version manager (asdf), language‑specific package managers
• Declarative config for NixOS and Home Manager
• Plugin‑driven editor configurations