How kentoje/dotfiles works
Main Components
• Dotfiles Repository: The central codebase containing all configurations, setup scripts, and assets.
• Nix System Configuration:
– Separate configurations like nix-darwin-pro and nix-darwin-mini along with general Nix flake files.
– These are responsible for installing Homebrew packages (via Nix) and managing system-level configuration.
• Stow Configuration:
– This represents how the repository uses GNU Stow to create symlinks from the dotfiles repository to the home directory.
• Application/Tool Configurations:
– Terminal emulators (Alacritty, kitty, wezterm)
– Shell (fish) with its completions, functions, and plugins.
– Editors (nvim and its extensive plugin setup)
– Utility tools (tmux, lazygit, btop, sketchybar, hammerspoon, etc.)
• Assets & Setup Scripts:
– Setup scripts in the “setup” directory automate system initialization on macOS.
Relationships & Dataflows
• Installation Process:
– The “setup/macos” scripts are executed first to initiate system-level tasks (installing Nix, running Stow to symlink dotfiles).
– These scripts use Nix to install and maintain Homebrew applications and system packages.
• Symlink Management:
– Stow reads the structure within the dotfiles repository and creates symlinks in the appropriate home directory locations.
• Application Configuration:
– Once symlinked, each individual application (such as nvim, tmux, fish, etc.) reads its configuration from the dotfiles.
• Update & Management:
– A “nix flake update” process is defined in the README, indicating that the Nix configurations have a directed update and rebuild cycle (using commands like “darwin-rebuild”).
Architectural Patterns & Design Principles
• Modularity: Each configuration an application is isolated in its own directory (e.g., .config/nvim, .config/fish, .config/tmux, etc.), making it clear which file belongs to which tool.
• Declarative Management: Use of Nix and flakes promotes a declarative, reproducible system setup.
• Automation & Scripting: The “setup/macos” scripts and configuration files for package managers help automate environment provisioning.
• Separation of Concerns: System-level configuration (via Nix and stow) is clearly separated from application-specific configurations.