Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions nixos/docs/darwin-post-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ Run these tasks after initial deployment on a new Mac.
- [ ] Clone notes repo: `git clone git@github.com:<user>/notes.git ~/Notes`
- [ ] Clone other personal repos as needed

## Frigate ANE Detector (dungeon only)
The `frigate-detector` launchd agent (hosts/macs/dungeon/default.nix) runs the native
Apple-Silicon object detector that Frigate connects to over ZMQ. It is not auto-cloned:
- [ ] `git clone https://github.com/frigate-nvr/apple-silicon-detector ~/Git/apple-silicon-detector`
- [ ] `cd ~/Git/apple-silicon-detector && /opt/homebrew/bin/python3.11 -m venv venv`
- [ ] `./venv/bin/pip3 install -r requirements.txt`
- [ ] Re-run `darwin-rebuild switch` so the agent finds the venv, then verify:
`tail ~/Library/Logs/frigate-detector.log` shows "ZMQ server successfully bound to tcp://*:5555"

## Launch Applications

- [ ] Set up AeroSpace tiling
Expand Down
27 changes: 27 additions & 0 deletions nixos/hosts/macs/dungeon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,31 @@
StandardErrorPath = "/Users/${vars.user.name}/Library/Logs/mac-battery-textfile.log";
};
};

# ---------------------------------------------------------------------------
# Frigate object detection on the Apple Neural Engine.
# Frigate runs in OrbStack's Linux VM, which can't reach the ANE — so the
# detector (frigate-nvr/apple-silicon-detector) runs NATIVELY here and Frigate
# connects from the container over ZMQ/TCP (config: detectors.type=zmq,
# endpoint=tcp://host.docker.internal:5555). This moves the single biggest
# CPU consumer (CPU inference was ~64% of Frigate's load) onto the Neural
# Engine. Run in AUTO mode: Frigate ships the yolov9 model over ZMQ on connect.
# Manual one-time install (not auto-cloned — see darwin-post-deploy.md):
# git clone https://github.com/frigate-nvr/apple-silicon-detector ~/Git/apple-silicon-detector
# cd ~/Git/apple-silicon-detector && /opt/homebrew/bin/python3.11 -m venv venv
# ./venv/bin/pip3 install -r requirements.txt
launchd.user.agents.frigate-detector = {
serviceConfig = {
ProgramArguments = [
"/Users/${vars.user.name}/Git/apple-silicon-detector/venv/bin/python3"
"-u"
"/Users/${vars.user.name}/Git/apple-silicon-detector/detector/zmq_onnx_client.py"
];
WorkingDirectory = "/Users/${vars.user.name}/Git/apple-silicon-detector";
RunAtLoad = true;
KeepAlive = true;
StandardOutPath = "/Users/${vars.user.name}/Library/Logs/frigate-detector.log";
StandardErrorPath = "/Users/${vars.user.name}/Library/Logs/frigate-detector.log";
};
};
}
Loading