Not just the first household's machines: a home server of your own runs speech, the status page, and the brain, and a household flake of your own makes the box, from a few names. - speech: sudo make install: the server, its models, its key, and its systemd unit, answering only the private network - box: make keys, from the home server: each connection's key piped to both its ends, never on disk but where it's used - docs/setup.md: the setup guide, from the household repository to teaching it the remotes - README: the home server; Make your own Generated-by: Claude Opus 5.5
3.9 KiB
Setting up the agent at the TV
You'll need the parts, a Linux home server with Nix and systemd, a private network both it and the box can join (Tailscale, by default), and an afternoon. The steps below are in the order they depend on each other. Each make target says more with make help.
1. Make a repository for your household
A private git repository of your own holds what's yours: the names you choose, and later who the brain serves. None of that belongs in pdtv26. Its flake.nix:
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
inputs.pdtv26 = {
url = "git+https://git.inference.coop/dckc/pdtv26";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { pdtv26, ... }: {
nixosConfigurations.pimote = pdtv26.lib.mkBox {
name = "pimote"; # the box's host name on your network
server = "den-pc"; # your home server's host name: speech and the brain
wifi = "MyNetwork"; # your Wi-Fi network's name (SSID), spelled exactly
admin = "pat"; # who looks after the box, and logs in to deploy
sshKeys = [ "ssh-ed25519 AAAA... pat@laptop" ];
};
};
}
Ports have defaults, and the box finds the IR emitter by its USB IDs. Anything else about the box's system goes in modules = [ ./household.nix ], alongside: a status page (pdtv26.box.statusUrl), another Wi-Fi network, another private network (pdtv26.box.network), or no camera (pdtv26.box.look.enable = false).
2. Set up the home server
Any Linux with systemd and Nix will do; it needn't be NixOS. Clone pdtv26 there, then:
sudo make -C speech install: the speech server, its models (about 200 MB), its key, and its systemd unit.sudo make -C status install BOX=pimote: the status page, if you want one.
The brain comes after the box, in step 5, since it needs the box's keys.
3. Make the box's SD card
On any Linux machine with Nix that can run ARM programs (on Debian or Ubuntu, apt install qemu-user-static), in pdtv26's box/:
make image FLAKE=path/to/household BOX=pimote, thenmake card DEV=/dev/sdXto check you have the right device, andmake flash DEV=/dev/sdX CONFIRM=erase.make wifi-secret SSID=MyNetwork: it puts the network's PSK on the card from the passphrase in your desktop keyring, not in the image or the repository. Store the passphrase there once, withsecret-tool store --label="Wi-Fi MyNetwork" service wifi ssid MyNetwork.- Put the card in the Pi, plug in the IR emitter's USB cord, and power it up.
After this, changes to the box go over ssh: make deploy FLAKE=path/to/household BOX=pimote.
4. Join the private network
On the box and the home server: tailscale up, or whatever private network you use.
5. Make the keys, and start the brain
On the home server, as the user the brain will run as, in pdtv26's box/:
make keys BOX=pimote ADMIN=pat: one key per connection, piped to both its ends; the box's ir and look keys come back for the brain. Put the camera's RTSP URL in~/.config/pdtv26-camera/rtsp-urlfirst, or skiprtsp-url.- Make a fine-grained GitHub token for one repository, Issues read/write only, for problem reports, and save it as
~/.config/pdtv26-brain/report-token. make -C ../brain install BOX=pimote REPO=you/your-repo ASSIGNEE=you, thenmake -C ../brain attachonce: log in, trust the folder, and approve the box's channel.
6. Tell it who it's for
The brain reads ~/pdtv26-brain/household.md: who looks after it, who it serves, what they like to watch, what to be patient about. make install puts an example there; make it yours, and keep it in your household repository.
7. Teach it your remotes
Press the button and ask: "Learn my TV's power button." Point the TV's remote at the IR emitter and press Power when it asks. Do the same for Input, the cable box, and the rest. It keeps what it learns in its notes.