787427e7c8
Brings up otbr-agent against the ZBT-2 over Spinel/UART, opens the REST API on :8081, and wires HA's otbr + thread integrations so Matter-over-Thread devices can commission through the existing matter-server. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
63 lines
1.4 KiB
Nix
63 lines
1.4 KiB
Nix
# manages home automations
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
self,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.my.profiles.home-assistant;
|
|
hostName = config.networking.hostName;
|
|
in
|
|
{
|
|
imports = [
|
|
# services.openthread-border-router isn't in nixos-25.11; pull from
|
|
# nixpkgs-unstable. Package comes from the existing unstable overlay.
|
|
"${self.inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/openthread-border-router.nix"
|
|
];
|
|
|
|
options.my.profiles.home-assistant = with lib; {
|
|
enable = mkEnableOption "Home Automation";
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.matter-server.enable = true;
|
|
|
|
services.home-assistant = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
extraComponents = [
|
|
"matter"
|
|
"mobile_app"
|
|
"otbr"
|
|
"thread"
|
|
];
|
|
};
|
|
services.home-assistant.config = {
|
|
name = "Home - Rechberg";
|
|
unit_system = "metric";
|
|
mobile_app = {};
|
|
};
|
|
|
|
services.openthread-border-router = {
|
|
enable = true;
|
|
package = pkgs.unstable.openthread-border-router;
|
|
openFirewall = true;
|
|
backboneInterfaces = [ "enp3s0" ];
|
|
radio.device = "/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_DCB4D9149C7C-if00";
|
|
};
|
|
|
|
my.homepage.services = [
|
|
{
|
|
group = "Services";
|
|
name = "Home Assistant";
|
|
description = "Home automation";
|
|
href = "http://${hostName}:8123";
|
|
icon = "si-homeassistant";
|
|
}
|
|
];
|
|
};
|
|
}
|