Devtools
My personal developer workbench, defined declaratively with Nix. One command takes a clean machine to a fully configured environment: system settings, applications, CLI tooling, shell, dotfiles, and an AI agent harness.
Everything is reproducible and version controlled. Configuration files are symlinked back into this repo, so editing a config here takes effect immediately without a rebuild.
Supported Platforms
| Platform |
Status |
macOS on Apple Silicon (aarch64-darwin) |
Supported |
| Windows on x86_64, in Git for Windows' bash |
Supported |
| macOS on Intel |
Not supported |
| WSL |
Not supported (the Windows path is native, not WSL) |
Install
git clone https://github.com/andrew-codes/devtools.git ~/developer/repos/devtools
cd ~/developer/repos/devtools
./setup.sh # the personal profile, the default
./setup.sh --profile work # or the work profile; see Profiles below
setup.sh detects the OS and architecture and dispatches to the matching platform script: setup/macOS.sh on Apple Silicon, setup/windows.sh on Windows. On any other platform it prints what was detected and exits rather than attempting an install.
Pass --profile personal or --profile work to pick what the machine gets (see Profiles). The choice is recorded, so later runs and devtools-rebuild need no flag.
On macOS nothing needs to be preinstalled; the setup script bootstraps Nix itself. On Windows, run it from Git for Windows' bash -- you already have that, since it is what cloned this repo.
macOS
The macOS script:
- Installs Determinate Nix if
nix is not already present.
- Symlinks the repo to
~/.dotfiles, which every config path resolves through.
- Offers to rewrite the
user = "..." line in flake.nix to match your macOS username.
- Trusts the Homebrew taps that already have something installed from them, so out-of-band installs survive later rebuilds. On a first-ever run there is no
brew yet, so this is a no-op.
- Acquires the Mac App Store apps listed in
mas-apps.nix that the profile keeps, with mas get, then waits for each to land on disk.
- Runs the first
darwin-rebuild switch against the flake's mac-<profile> output.
Sign in to the Mac App Store before step 5; mas cannot authenticate on its own, and it prompts for an admin password when it has real work to do. App Store apps are acquired here, as the real user in the real login session, rather than through nix-darwin's homebrew.masApps -- that option runs outside the per-user launchd session mas needs, so it would fail on every rebuild. homebrew.masApps is deliberately left empty.
Windows
Nix does not run natively on Windows, so setup/windows.sh carries by itself what nix-darwin and home-manager carry on macOS. It:
- Ensures the latest Git for Windows, upgrading only when one is available.
- Ensures native symlinks are allowed, enabling Developer Mode (one UAC prompt) if they are not. Every dotfile is a symlink into this repo, exactly as on macOS.
- Symlinks the repo to
~/.dotfiles.
- Installs applications and CLI tools with
winget.
- Installs the two things winget cannot deliver -- the Hack Nerd Font and
kubeseal (personal profile only) -- from their pinned upstream releases.
- Installs Node via Volta and the global agent CLIs, then the Go CLIs and the no-mistakes release binary from the
andrew-codes fork (see no-mistakes; the work profile also gets firstmate from a fork, see Fork tools).
- Links every dotfile, stubs
~/.env, merges Claude Code's settings and MCP servers, installs the AXI session hooks, applies the Windows system defaults, and, on the personal profile, installs the Windows OpenSSH client if it is missing (git needs it to reach 1Password's agent) and wires up 1Password commit signing.
Expect UAC prompts during the winget step. Re-running is safe and is the supported way to apply later changes.
setup/windows-parity.md is the map: every macOS package, config and system default, with what Windows does about it -- implemented, deliberately skipped with a reason, or deferred. Read it before adding anything to either platform.
Two consequences worth knowing up front: the shell is bash, not zsh, and WezTerm launches it by default; and the twg CLI is installed there from Atlassian's Windows binary via install.ps1.
Applying Changes Later
After the first install, rebuild from anywhere with:
devtools-rebuild # symlinked onto PATH on both platforms
On macOS that runs rebuild.sh (darwin-rebuild switch); on Windows it re-runs setup/windows.sh, which is idempotent. Both read the machine's recorded profile; devtools-rebuild --profile work switches it.
Profiles
Not every machine gets the same tools: a work machine may not be allowed 1Password, for one. A profile is a shared base plus a small overlay that removes things from it and, for work, takes firstmate from a fork.
| Profile |
What it is |
personal |
Everything in this repo. The default whenever nothing selects a profile, so existing machines behave as before. |
work |
The base without 1Password and its CLI, gitops, telepresence, Dynamic Wallpaper Library, fluxcd and kubeseal, and with firstmate taken from the andrew-codes fork (see Fork tools). |
The overlay lives in profiles.nix (and is repeated by hand in setup/windows.sh, since Nix cannot run there). The work profile also drops everything that existed only to serve 1Password: the SSH_AUTH_SOCK override, the ~/.1password/agent.sock link, the ~/.config/1Password/ssh/agent.toml link, the op-ssh-sign signer and core.sshCommand pin in the OS-specific git config, the 1Password IdentityAgent in the OS-specific ssh config, and on Windows the OpenSSH client step and 1Password signing step.
Commit signing stays on for both: commit.gpgsign and gpg.format = ssh are in the shared home/.gitconfig. The work profile sets no signer program and no key; the key comes only from ~/.gitconfig.local, which ~/.gitconfig includes unconditionally and which is never tracked. Add yours there after setup (the same reminder printed for personal).
Choosing a profile. setup.sh, setup/macOS.sh, setup/windows.sh and rebuild.sh all accept --profile personal|work and reject anything else. The choice is written to ~/.config/devtools/profile (outside the repo, one word) and read back when no flag is given; with neither, it is personal. On macOS rebuild.sh builds the flake output for that profile -- mac-personal or mac-work; plain mac is kept and is the personal one.
A profile only controls what gets installed and configured. Switching a machine from personal to work does not uninstall anything that is already there (Homebrew cleanup stays none), and a gpg.ssh.program that personal wrote into ~/.gitconfig.local on Windows needs removing by hand (setup warns).
no-mistakes (fork release binary)
Every profile, on both platforms, installs the no-mistakes release binary from github.com/andrew-codes/no-mistakes (GitHub releases), never from upstream kunchenguid/no-mistakes. The version is pinned: noMistakesVersion in home.nix and NO_MISTAKES_VERSION in setup/windows.sh (bump both). setup/no-mistakes.sh, one bash script shared by both platforms, downloads no-mistakes-v<version>-<os>-<arch>.tar.gz (.zip on Windows), checks it against the release's checksums.txt, and replaces ~/go/bin/no-mistakes (no-mistakes.exe on Windows) in one rename. A binary that already reports the pinned version is left alone. On macOS it runs as the installNoMistakes step of home-manager's activation; on Windows from Step 7 of setup/windows.sh.
The fork's macOS binaries are ad-hoc signed (arm64) or unsigned (amd64). curl sets no quarantine flag, so Gatekeeper never sees the download; the script still clears the flag, and re-signs an arm64 binary ad hoc if codesign --verify fails. A running daemon keeps its old binary until no-mistakes daemon restart; on Windows a running daemon locks the .exe, so the script warns (run no-mistakes daemon stop and re-run).
Fork tools (work profile)
personal installs no copy of firstmate; home/bin/firstmate only expects a checkout at ~/developer/firstmate. work instead tracks the main branch of the fork, unpinned:
| Tool |
Fork |
Where it lives |
| firstmate |
github.com/andrew-codes/firstmate |
cloned to ~/developer/firstmate |
It is setup/fork-tools.sh, one bash script shared by both platforms. On macOS it runs as the installForkTools step of home-manager's activation (home.nix, work profile only), so devtools-rebuild runs it and nothing happens during Nix evaluation, which stays pure. On Windows it runs from Step 7 of setup/windows.sh. The clone goes over HTTPS (the repository is public, so there is no credential), never with a token.
Every run fast-forwards the clone to the fork's main. It never commits, resets, checks out, cleans or forces anything. A checkout is left exactly as it is, with a warning, while the rest of setup carries on, when it is not a git checkout of its own, has an origin other than the fork, has uncommitted changes (including untracked files), is mid merge or rebase, is not on main, or has local commits or has diverged from the fork's main. Fix the checkout and re-run.
Required Manual Steps
Two files hold values that are specific to a single machine or are secret, so they are never tracked in this public repo.
| File |
Purpose |
~/.env |
Secrets. Auto-created with every required key stubbed empty. The shell warns on every startup until each has a value. On the personal profile that includes OP_SERVICE_ACCOUNT_TOKEN (the agents vault's 1Password service account token); set it in ~/.env and every shell, including cc, inherits it. |
~/.gitconfig.local |
This machine's git SSH signing key and author email (git config --file ~/.gitconfig.local user.email you@example.com); the tracked config sets neither. Setup prints a reminder if either is missing. On the personal profile on Windows it also holds the resolved 1Password signer path. |
~/.config/devtools/profile |
The machine's profile, personal or work. Written by --profile; see Profiles. |
~/.ssh/config.local |
Optional. Personal SSH hosts, included from the tracked ~/.ssh/config. |
Note: Homebrew uses onActivation.cleanup = "none", so packages installed outside this repo are left alone on rebuild. Existing files at a managed path must be moved aside before the first activation; home-manager will not clobber them. setup/windows.sh moves them aside itself, to <name>.bak.
What You Get
Shell
- zsh on macOS with autosuggestions (
Ctrl-F to accept) and syntax highlighting; bash on Windows (home/.bashrc), where Up/Down search history in place of autosuggestions and there is no syntax highlighting.
- A starship prompt on both, showing directory, git branch/status, and command duration. Its config is a tracked
home/.config/starship.toml shared by both platforms.
- Secret loading.
~/.env is sourced and exported at startup so child processes (agents, MCP servers) inherit it.
- Completions. Tab-completion for the custom commands below. They are bash
complete -F scripts, loaded natively by bash and through bashcompinit by zsh.
- Aliases:
.., add, m, cc, co.
Custom Commands
Scripts in home/bin/ are symlinked individually into ~/.local/bin. They are bash, so they run on both platforms.
| Group |
Commands |
| Agents |
firstmate (launch pi inside the firstmate repo) |
| Git |
gco db fa glg gnxt gwta lb nb pmb pull push rba rbc rbi rbs rh rs sb st stash |
| Docker |
denv dka |
| Projects |
oproj projs (open and list repos under $REPO_HOME) |
| Ports |
aup (show what is listening on a port) kaup (kill it) |
CLI Toolchain
Installed from nixpkgs on macOS: ripgrep, fd, eza, fzf, jq, yq, lazygit, neovim, uv, shfmt, gh