2023-06-12 15:04:12 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
options,
|
|
|
|
pkgs,
|
2023-10-01 20:20:38 +00:00
|
|
|
inputs,
|
2023-06-12 15:04:12 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.pub-solar.home-assistant;
|
2023-10-01 20:20:38 +00:00
|
|
|
unstable = import <nixos-unstable> {};
|
2023-06-12 15:04:12 +00:00
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
./home-assistant.nix
|
|
|
|
./mqtt.nix
|
|
|
|
./zigbee.nix
|
2023-10-01 20:20:38 +00:00
|
|
|
(inputs.latest + "/nixos/modules/services/home-automation/home-assistant.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledModules = [
|
|
|
|
"services/home-automation/home-assistant.nix"
|
2023-06-12 15:04:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
options.pub-solar.home-assistant = {
|
|
|
|
enable = mkOption {
|
|
|
|
description = "Control your home";
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
config = options.services.home-assistant.config;
|
|
|
|
extraComponents = options.services.home-assistant.extraComponents;
|
|
|
|
extraPackages = options.services.home-assistant.extraPackages;
|
|
|
|
|
|
|
|
mqtt = {
|
|
|
|
enable = mkOption {
|
|
|
|
description = "use mqtt";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = mkOption {
|
|
|
|
description = "mqtt users";
|
|
|
|
# type = types.AttrSet;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
zigbee2mqtt = {
|
|
|
|
enable = mkOption {
|
|
|
|
description = "Enable zigbee2mqtt";
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
device = mkOption {
|
|
|
|
description = "Device to connect to zigbee network";
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
adapter = mkOption {
|
|
|
|
description = "Specify zigbee adapter type";
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|