Dotfiles for macOS (relevant for Catalina 10.15+)
sudo softwareupdate -i -a
mkdir -p ~/projects/personal && cd ~/projects/personal
git clone https://github.com/mvshmakov/dotfiles.git && cd dotfiles
git submodule update --recursive --init
./home/scripts/setup.shEverything is declared in nix-darwin:
CLI tools from nixpkgs via home-manager, GUI apps as Homebrew casks, Mac App
Store apps via mas, macOS defaults, and the dotfile symlinks themselves
(every top-level directory mirrors $HOME and is linked into it by
home-manager, editable in place). setup.sh installs Homebrew and
Determinate Nix and runs the first darwin-rebuild switch. Afterwards:
make nix-check # build + preflight checks, nothing is activated
make nix-switch # apply (sudo)
make nix-update # bump flake.lock, then nix-check/nix-switchThe migration from the Brewfile is staged; the runbook with the remaining
phases lives in nix-darwin/.config/nix-darwin/README.md.
Adding a tool's config = adding a <tool>/.config/<tool>/... directory and
running make nix-switch; removing it removes the link. Retired configs live
in .archive/ (hidden directories are not packages).
If you want to add the submodule, consider running git submodule add --name {name} https://github.com/{author}/{name}.git {tool}/.config/{tool}/{name} instead of just adding the corresponding submodule definition in the .gitmodules. If you want to delete the submodule, see delete_git_submodule.md.
ITerm2's com.googlecode.iterm2.plist is in the $HOME folder, so you need to set it also in ITerm2 settings to load it.
The last step would be to generate new SSH key pair and add it to the required services.
One should also enable the Reduced motion option in the System Preferences to increase the speed of window/desktop switching.
- Dump all the installed brew packages:
brew list > packages.txt - Dump all the installed brew casks:
brew list --cask > casks.txt - Dump all VSCode extensions to shell commands:
code --list-extensions | xargs -L 1 echo code --install-extension
z {pattern}[TAB]will expand the path Z detected
Homebrew is driven by nix-darwin: make nix-switch runs brew bundle against
the Brewfile generated from homebrew.nix (HOMEBREW_BUNDLE_FILE points at
it). brew/.config/brew/Brewfile is frozen until the phase-2 cleanup.
How to upgrade brew:
brew updateupdate brew itselfbrew upgrade --greedyupdate all the packages together with :latest and :auto_update
- Run
:Copilot setup
- Daemon mode requires a socket to be available, the
brew services start atuinsolves this
Both auto-start on boot: their launchd plists are versioned in launchctl/ (whitelisted in .gitignore) and ~/Library/LaunchAgents is a symlink to that directory. home/scripts/services.sh bootstraps them during setup; afterwards launchd loads them on every login.
- Manage the services with the official commands only:
yabai --start-service/--stop-service/--restart-service(same forskhd). - Never run
--install-service/--uninstall-service:~/Library/LaunchAgentsis a symlink into this repo, so they would overwrite/delete the tracked plists (an unexpected plist diff ingit statusis the telltale). The tracked plists match the generated ones except forPATH, which is trimmed to a stable machine-agnostic set instead of a snapshot of the installing shell'sPATH. - One-time manual step per machine: grant Accessibility to
yabaiandskhd, plus Input Monitoring toskhd(System Settings -> Privacy & Security; macOS prompts on first start). - The yabai scripting addition is not used, so no SIP/sudoers changes are needed.
- The skhd plist/label must stay
com.koekeishiya.skhduntil an skhd release ships the author's account rename (koekeishiya -> asmvik) - the binary hardcodes that label and plist path. yabai has already migrated tocom.asmvik.yabai.
home/scripts/claude.sh (run by setup.sh, safe to re-run) merges home/scripts/claude/settings.json (model, plugins, permissions, opt-outs) into ~/.claude/settings.json, installs the listed plugins (enabledPlugins alone installs nothing on a new machine) and graphify's skill. ~/.claude/settings.json stays a local file: its autoMode rules describe private infrastructure and only work in user settings. A plugin installed later via /plugin lands only in the local file; copy it to the repo file to share it.
Manual, once per machine:
- User MCP servers:
claude mcp add --scope user --transport http figma http://127.0.0.1:3845/mcp;telegramcarries credentials. - Bitwarden CLI for the
bitwardenMCP server (added byclaude.sh):bw config server <your Vaultwarden URL> && bw login --apikey(Vaultwarden, tailnet-only; personal API key from web vault → Settings → Security → Keys, because the CLI cannot do WebAuthn 2FA and plainbw loginfails with "No providers available for this client"). Agents then call itsunlocktool, which asks for the master password in a native dialog;lockends the session. - Desktop app (chat/Cowork), with the app quit (a running app rewrites the file from memory): add
chrome-devtools(npx -y chrome-devtools-mcp@latest --no-usage-statistics --isolated --config ~/.config/cd4a/config.json, absolute paths;--isolatedbecause the app also hands the server to Code sessions, and two copies cannot share one Chrome profile) tomcpServersin~/Library/Application Support/Claude/claude_desktop_config.json.cd4a/.config/cd4a/config.jsonturns on the opt-in memory-analysis and PWA tools; released versions read it only via--config. - Second desktop profile ("Claude Work"):
open -n -a /Applications/Claude.app --args --user-data-dir="$HOME/.claude-instances/work"(its config is~/.claude-instances/work/claude_desktop_config.json).
- Warn about exiting from the git commit message template on non-empty message.
- If possible, simplify the GPG signature sign in git log to make it smaller but still present.
- Use
markdownlintfor the documentation. - Run
prettieronmd/yml/etc. on pre-commit. - Use
shfmt+shellcheck+checkbashismson scripts from dotfiles + document it. - Align all shell scripts with Google shell scripting guidelines + apply all the linting.
- Run CI with pre-commit hooks.
- Use
git subtreeinstead ofgit moduleto manage dependencies.
- macOS Config
- Colors in terminal
- ANSI Escape Sequences
- "[WTF IS \033[30;47m???", a practical cheat-sheet
- sudo insults - though for macOS it is needed to recompile the
sudobinary to enable --with-all-insults - Which nerd font to select