The reason you are still seeing command not found is that darwin-rebuild does not exist on your computer yet.When doing a brand-new installation of nix-darwin, the darwin-rebuild tool is not part of the standard Nix installer. You have to bootstrap it using the nix run command first, which will dynamically pull the tool from GitHub and execute the initial build.Run the following command from your terminal inside your ~/.dotfiles directory:zshsudo nix run nix-darwin#darwin-rebuild -- switch --flake ~/.dotfiles#lt-mbp
## firstmate + Gitea (one-time per machine, secrets not in nix)
The firstmate crew dispatch + Gitea PR helper are wired by `darwin-rebuild`, but two secrets must be set manually per machine (nix cannot manage tokens without exposing them):
Verify: `fm` launches Pi as the first mate (accept project trust once); `oc2 --version` prints an OpenCode 2 version; `pi --list-models mimo` shows `opencode-go/mimo-v2.5-pro`; `tea pulls list --repo transnet/investor-flow` works.
`home.activation.securityAuditSkill` installs Cloudflare's `security-audit` skill from `https://github.com/cloudflare/security-audit-skill` so the coding agents can run a structured vulnerability audit. The exact command:
The install needs Homebrew's `node`, which `configuration.nix` already declares, plus the system Git at `/usr/bin/git` for the clone. Renew or update the skill by hand with:
Agent scope: the Skills CLI installs the bundle once under `~/.agents/skills/security-audit`, the universal user-level directory that Codex, Pi, and OpenCode read, and it links that directory into `~/.claude/skills` for Claude Code. Grok Build is out of scope for this install: its skill directory is `~/.grok/skills`, and the CLI only populates it when `grok` is named in `--agent`. The install leaves `~/.config/opencode/skills` alone because home-manager owns that path with `force = true` and `mkOutOfStoreSymlink` into the mutable dotfiles checkout: a rebuild would clobber the CLI's link, and CLI writes would land in the git checkout. That is why the install uses the shared directory instead.
The activation is idempotent and non-interactive: it skips the install when both the canonical copy and the Claude Code link exist, and a failed download only warns so the rebuild still completes. Trigger it in an agent with "security audit this codebase".
Sandbox: the skill's README requires an OS-enforced sandbox (no external network, sanitized environment, resource limits, scratch-only writes) before it may run target-controlled builds, tests, browser automation, emulators, fuzzers, or fixtures. `security-audit-sandbox` below provides that sandbox. Run target code only through it; otherwise the workflow keeps such leads as `needs_validation` rather than executing target code.
## Security audit sandbox
`security-audit-sandbox` (installed as `~/.local/bin/security-audit-sandbox`) runs untrusted target code in a Docker container. It is for target code only: do not run the audit agent or your own tools inside it.
security-audit-sandbox exec ~/code/myapp [--timeout 600] -- npm test
security-audit-sandbox stop ~/code/myapp [--keep]
security-audit-sandbox status ~/code/myapp
```
`start` canonicalizes the app path, copies the app to `~/security-audit-runs/<slug>.XXXXXX`, and starts a detached container. The original app directory is never mounted into the container, so the copy is the only thing the target code can see.
Image resolution order:
1.`--image`
2.`IMAGE=` in the app's `security-audit.conf`
3. Inference: `package.json` gives `node:22-bookworm`, `pyproject.toml` or `requirements.txt` gives `python:3.12-slim`, `go.mod` gives `golang:1.24-bookworm`, `Cargo.toml` gives `rust:1-bookworm`, and `Gemfile` gives `ruby:3.3-bookworm`.
`start` stops with an error when nothing resolves an image. To support another runtime, add a marker file mapping or pass `--image`.
The optional `security-audit.conf` in the app root holds simple `KEY=value` lines. It is parsed, never sourced:
`EXCLUDE=` is a whitespace-separated list, and the key may be repeated: every `EXCLUDE=` line applies. CLI `--exclude` patterns are added on top of it. The copy always excludes `.git`, `.env*`, and the top-level `/data` directory, so secrets and live data stay on the host.
-`--network none`: no external network, only loopback for local tests.
-`--read-only` root with writes limited to the bind-mounted scratch directory at `/scratch`, plus a 512 MiB tmpfs at `/tmp`.
-`HOME=/scratch/home`, `TMPDIR=/scratch/tmp`, and `XDG_CACHE_HOME=/scratch/cache`.
- Runs as your host UID:GID, with `--cap-drop ALL`, `no-new-privileges`, and `--init`.
-`--memory 4g`, `--cpus 2`, `--pids-limit 256`, and `nofile=1024:1024`.
-`fsize=104857600` (100 MiB) when the Docker host accepts it. Docker Desktop on macOS may refuse `fsize`; the wrapper then starts without only that cap and prints a warning.
`exec` runs the command from `/scratch/app` under `timeout --signal=KILL`, default 600 seconds. It passes no host environment variables. If the image has no `timeout` binary, or its `timeout` does not enforce the `--signal=KILL` wall-clock limit, `exec` refuses to run rather than dropping the limit.
`stop` removes the container, the state file, and the run directory. Pass `--keep` to keep the run directory for inspection. State lives under `${XDG_STATE_HOME:-~/.local/state}/security-audit-sandbox` and is keyed by the canonical app path, so `exec`, `stop`, and `status` find the same run.
Use dummy data only. The exclusions cover common secrets and the top-level `data` directory, not every possible secret path. Review the copied tree, or add `--exclude` patterns, before you run a target that reads credentials from unexpected places. Audit findings do not belong in this repo or in the run directory.
Hold a shortcut, speak, release, and the transcript pastes into the focused app. Everything runs on the Mac: no audio or transcript leaves the machine.
1. The `opensuperwhisper` cask is installed and `home.activation.openSuperWhisper` pre-downloads the model to `~/Library/Application Support/ru.starmel.OpenSuperWhisper/whisper-models/ggml-large-v3-turbo.bin`. It selects "Whisper V3 Large" only when no model is selected or the selected file is gone, so a model you pick in the app stays selected.
3. Grant **Microphone**, **Accessibility**, and **Input Monitoring** when macOS asks. Input Monitoring is needed because the trigger is Right Option, a single modifier key.
4. Keep the Right Option trigger (or change it in the app's settings). Hold it, speak, release. Auto-paste puts the text into the focused terminal or editor.
- A fresh install starts with Option plus backtick instead of Right Option, and that combination needs no Input Monitoring. The activation never writes the trigger, the language, or the paste settings, so whatever you choose in the app survives the next rebuild.
- The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download the large Turbo V3 model ("Turbo V3 large" in the app's Settings) by hand.