Watch the walkthrough: https://youtu.be/5N-okeDdIuI
My personal Mac setup, managed with nix-darwin and home-manager. One repo, one command, and a fresh Mac ends up configured the same way every time.
These are my personal dotfiles, shared publicly so people can read them, learn from them, and fork them freely. Feature requests and pull requests are not accepted here, and PRs are auto-closed. If you find a bug, please open a GitHub Issue using the bug report template.
Running the switch builds:
- System settings (dark mode, key repeat, dock, Finder, trackpad)
- Homebrew apps (casks and CLI tools)
- Nix user packages (ripgrep, fd, fzf, jq, lazygit, Neovim, Hack Nerd Font)
- Shell (zsh, aliases, starship prompt)
- Editor (Neovim follows macOS appearance: GitHub Dark Default and GitHub Light Default)
- Terminals (WezTerm and Ghostty follow system appearance: Catppuccin Mocha dark, Latte light)
- SketchyBar (Catppuccin status bar with AeroSpace workspaces, active app, volume, battery, and clock)
- Agent configs (Claude, Codex, opencode all share one AGENTS.md)
- Apple Silicon Mac, by default.
- Intel Mac: change one line.
In
configuration.nix, setnixpkgs.hostPlatform = "x86_64-darwin";(the comment right there tells you the same thing).
On a brand new Mac, from a bare clone of this repo:
git clone https://github.com/dimajarkov/dotfiles.git
cd dotfilesBefore you run it: review "Make it yours" below.
Change the host label or CPU architecture if needed, and read the Homebrew cleanup warning.
bootstrap.sh applies the config to your machine, so do this first.
./bootstrap.shbootstrap.sh does four things, in order:
- Installs Determinate Nix, if it isn't already installed.
- Symlinks this repo to
~/.dotfiles. This has to happen before the first build, becausehome.nixpoints at config files through~/.dotfiles. - Checks the
userconfigured inflake.nixagainst your actual macOS username, and offers to fix it for you if they differ. - Runs the first
darwin-rebuild switch. It fetches thedarwin-rebuildtool from the nix-darwin 26.05 release branch, then applies this repo's locked flake config.
After that, darwin-rebuild exists and you're on the normal workflow below.
Once Nix is installed (bootstrap.sh step 1 handles that), you can check that the config builds without touching your system - handy when you have edited something:
nix flake check --no-build
nix build .#darwinConfigurations.mac.system --dry-runIf you renamed the host label in "Make it yours", substitute your label for mac in these commands.
Edit the config files in place, then apply:
./rebuild.shThat's it. No separate build-and-copy step.
For the ci-runner account reached through Herdr's saved Yuri machine, use the
worker account profile instead of the desktop system rebuild.
It reuses the development configuration without changing Yuri's desktop or Homebrew packages.
Ghostty and WezTerm are both declared Homebrew casks; keep WezTerm installed while trying Ghostty.
Launch Ghostty from Applications or with open -a Ghostty.
Its config lives in home/.config/ghostty/config.ghostty, linked by Home Manager to ~/Library/Application Support/com.mitchellh.ghostty/config.ghostty.
It uses Hack Nerd Font Mono at 14 points, Catppuccin light/dark themes, 98% background opacity, and a hidden title bar.
Option-1 through Option-5 switch tabs; Cmd-Shift-V sends terminal image paste, while Cmd-V remains normal text paste.
Shift-PageUp and Shift-PageDown are forwarded to terminal applications.
Use Cmd-Shift-P for Ghostty's command palette; WezTerm's custom theme picker and cycling shortcuts are not ported.
Global app-switching shortcuts are unchanged during the trial.
Rex is a separate terminal/multiplexer, not a Ghostty plugin. As checked on 2026-11-17, its macOS beta requires an invitation through Superlogical's mailing list. Rex is not installed or declared here until an official download is available.
home/.config/lazygit/config.yml is live-linked into LazyGit's macOS config directory.
Restart LazyGit after editing it; no rebuild is needed.
Diffs use Delta with Catppuccin Mocha syntax colors, subtle added/removed backgrounds, word-level emphasis, and explicit +/- markers.
Unified diffs omit the line-number gutter so long lines can wrap across the full pane without running underneath a separator.
The sidebar uses a quarter of the width and expands the focused panel vertically.
Delta receives the actual diff-pane width and uses four-space tabs.
Press + to enlarge the focused panel and _ to shrink it again.
Line staging keeps LazyGit's native diff view.
Handy is installed through the Homebrew handy cask declared in configuration.nix.
After applying the config, launch Handy, grant Microphone and Accessibility permissions, download a transcription model, and configure your recording shortcut.
Speech transcription runs locally.
This repo is mine.
If you clone it, review these before you run bootstrap.sh:
- Username: run
./bootstrap.sh(it detects your macOS username and offers to set it) OR change the singleuser = "dmitrijarkov"line inflake.nix. Everything else (configuration.nix,home.nix, home directory paths) is threaded from that one variable. - Host label
"mac", in three places:flake.nix(thedarwinConfigurations."mac"name),rebuild.sh:5(the#macat the end of the flake reference), andbootstrap.sh's first-switch command (also#mac). All three have to match. - CPU architecture,
hostPlatforminconfiguration.nix(see Prerequisites above).
Git identity: home.nix sets my git name and email declaratively.
Before applying this config, replace both values with your own identity or remove them and configure Git separately.
programs.git = {
enable = true;
settings = {
user.name = "Your Name";
user.email = "you@example.com";
};
};Homebrew cleanup warning: configuration.nix sets homebrew.onActivation.cleanup = "zap".
That means every time you switch, Homebrew removes any package or cask on your machine that isn't listed in the brews and casks arrays in configuration.nix.
If you already have Homebrew stuff installed that isn't in that list, the first switch will uninstall it.
Read through brews and casks before you run bootstrap.sh or rebuild.sh for the first time, and add anything you want to keep.
About herdr: Homebrew installs the original upstream herdr formula from homebrew-core.
The custom Pi interactive-subagents package is disabled because upstream Herdr lacks its required managed job and cooperative Pi control APIs.
Pi itself remains Nix-managed and works without that package.
Oh My Pi is also Nix-managed as omp, with its own configuration and credentials plus the shared agent instructions and skills.
See Herdr installation history for the former fork and rollback context.
Herdr mobile: The phone app uses herdr-core, not the separate Herdr TUI server installed by Homebrew.
The signed upstream macOS installer owns ~/.local/bin/herdr-core and its hc alias, backed by ~/.local/share/herdr-core/active/Herdr Core.app.
This is intentionally upstream-managed rather than Nix-managed to preserve the signed app bundle and its macOS privacy identity.
To install, download and inspect https://releases.herdr.dev/core/install.sh, then run the saved script with /bin/sh; update with hc update.
Use hc server status to inspect the runtime and hc run --bg <program> to start a terminal accessible from the phone over SSH.
Existing Herdr TUI sessions do not appear in core, and installing core does not migrate or stop them.
Heads-up:
home/AGENTS.mdis my personal agent policy, andhome.nixinstalls it for Claude, Codex, and opencode. If you clone this repo, you'd silently inherit my agent instructions - edit or deletehome/AGENTS.mdif you don't want that.- The
ccandcoshell aliases inhome.nixare high-agency shortcuts:claude --dangerously-skip-permissionsandcodex --sandbox workspace-write --ask-for-approval on-request. They're convenient for me, but know what they do before you use them. The feature-only Codex launcher translates a stale--full-autooption to those supported flags only when it is an option, not after--or as another option's value; it preserves the user's other arguments.
Fresh interactive Pi and Codex sessions in Git checkouts inside compatible Herdr 0.9.3 or newer can open one persistent Hunk review beside the coding session when its first change is observed. The default review shows the latest completed response; cumulative review, saved comments, and explicit feedback to the original native session remain available separately. See the review workflow and feature-only installation. Install this profile through its dedicated installer rather than a broader system rebuild. Native Codex hook approval and direct human confirmation of terminal appearance remain separate acceptance steps.
flake.nix- the entry point. Wires up nixpkgs, nix-darwin, home-manager, and nix-homebrew, and declares themacmachine.configuration.nix- system-level config: macOS defaults, Homebrew.home.nix- user-level config: shell, packages, prompt, and the symlinks described below.rebuild.sh- re-applies the config after the first switch. Run this every time you make a change.home/- the actual config files that get symlinked into place (Hammerspoon, Neovim, WezTerm, Ghostty, herdr, Claude settings, the sharedAGENTS.md).
The files under home/ are the real files - editing them here is editing your live config, no rebuild needed to see the change in your editor.
home.nix uses mkOutOfStoreSymlink to point paths like ~/.config/nvim straight at home/.config/nvim in this repo, so the two never drift out of sync.
You only run ./rebuild.sh when you change something that isn't just a symlinked file, like a package list or a system default.
Home Manager links ~/.agents/skills as one writable directory to home/.agents/skills in this repo.
Previously, only browser-routing and one-bin were linked individually, so other skills installed under ~/.agents/skills were not tracked here.
New skill installs and edits through ~/.agents/skills now land in the repo immediately and appear in Git status.
Runtime metadata such as ~/.agents/.skill-lock.json and other files at the ~/.agents root are not moved into the repo by this link.
Home Manager runs a read-only migration preflight before its file-collision checks, then repeats the validation and performs the cutover after its write boundary and before linking the new generation.
If Home Manager defines DRY_RUN, even with an empty value or 0, the cutover remains read-only.
The migration checks that every non-cache local file and directory is represented in the canonical repo directory, including file contents and executable bits.
It accepts skills-root child links that resolve to their matching canonical directories, including the old Home Manager links; other non-cache local symlinks, including nested symlinks, are refused.
It preserves the complete original directory in a unique sibling backup and never deletes backups.
Moving an existing directory requires macOS's atomic no-overwrite rename; other platforms refuse that cutover without moving the original directory.
Only .pyc, .pyo, __pycache__, and .DS_Store are excluded from validation; backups retain them too.
Compiled .pyd extensions are validated as regular data, not ignored as cache.
The single root ~/.agents/skills Home Manager target uses force = true because the validated cutover creates an out-of-store directory link that Home Manager cannot recognize as one of its generation links.
The migration refuses divergent or missing local data, unrelated root symlinks, and recursive paths, and never overwrites concurrently created paths.
Preview the migration directly before running the same command without --dry-run to apply it:
python3 nix/migrate-agent-skills.py "$HOME/.agents/skills" "$HOME/.dotfiles/home/.agents/skills" --dry-runRun the subprocess behavior tests with:
python3 tests/agent-skills.pyThe first time you launch nvim, Neovim's built-in vim.pack clones the configured plugins from GitHub.
That needs network access once; after that it's offline.
Neovim uses GitHub Dark Default in macOS dark mode and GitHub Light Default in light mode, with opaque backgrounds for readable contrast.
It reads the macOS appearance at startup, on focus, and every two seconds while open, without blocking editing or requiring a terminal theme notification.
A manual colorscheme selection (<leader>fc) lasts until the system appearance changes.
On non-macOS hosts, Neovim selects the palette using its background option, including terminal-driven changes.
WezTerm and Ghostty independently follow system appearance with Catppuccin Mocha and Latte.
Read a saved Markdown buffer with :Glow or <leader>mp (Space, M, P).
The preview runs Glow's interactive reader in a real terminal, using Glow's configured colors and width; scroll with the trackpad, mouse wheel, or j/k, and press q to return to the document and its original cursor position.
Inside Herdr, click a local file reference in the preview to open a new pane on the right, leaving the original preview open.
Markdown files open in Neovim with :Glow; other files open in the editor, honoring :line suffixes.
This supports plain paths, code-styled paths (including spaces and wrapped paths), and inline Markdown links to local files.
Relative paths resolve from the source document's directory, then its Git root, then Neovim's working directory; missing files and web URLs do not create panes.
The embedded reader disables Glow's legacy high-performance viewport to avoid blank or duplicated content when opening short files.
Restart Neovim after changing its configuration; no rebuild is needed for these symlinked files.
Glow 2.1.2 carries a local content-caching backport in nix/patches/glow-resize.patch to prevent blank previews when shrinking the terminal.
Run ./rebuild.sh to activate Glow package changes, then close any existing preview and reopen it with :Glow.
After launching Neovim once to install the plugins, run the Neovim regression tests from the repo root:
nvim --headless -u NONE -l tests/nvim-appearance.lua
python3 tests/nvim-appearance-tui.py # macOS: full TUI against the real system appearance
python3 tests/nvim-glow-tui.py # trackpad scrolling, visible content/colors after resizes, and returning to the source buffer
nvim --headless -u NONE -l tests/nvim-glow-references.lua # reference resolution and safe Herdr commands
python3 tests/nvim-glow-herdr.py # real clicks through an isolated Herdr TUI, right-hand panes, and automatic GlowThe Lua tests exercise both palettes, live changes, failure recovery, reload safety, and non-macOS behavior without changing the system appearance.
This repo is licensed under MIT No Attribution.
See LICENSE.