e8d09f40f6
Adds the `zha` extra component so Home Assistant can drive the Nabu Casa Connect ZBT-2 radio, and puts the `hass` service user in `dialout` so it can open `/dev/serial/by-id/usb-Nabu_Casa_..._ZBT-2_*`. Pairing is then handled through the standard ZHA wizard in the HA UI. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
50 lines
1012 B
Nix
50 lines
1012 B
Nix
# manages home automations
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.my.profiles.home-assistant;
|
|
hostName = config.networking.hostName;
|
|
in
|
|
{
|
|
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"
|
|
"zha"
|
|
];
|
|
};
|
|
services.home-assistant.config = {
|
|
name = "Home - Rechberg";
|
|
unit_system = "metric";
|
|
mobile_app = {};
|
|
};
|
|
|
|
# Allow the `hass` service user to open the ZBT-2 USB-CDC serial endpoint.
|
|
users.users.hass.extraGroups = [ "dialout" ];
|
|
|
|
my.homepage.services = [
|
|
{
|
|
group = "Services";
|
|
name = "Home Assistant";
|
|
description = "Home automation";
|
|
href = "http://${hostName}:8123";
|
|
icon = "si-homeassistant";
|
|
}
|
|
];
|
|
};
|
|
}
|