41 lines
731 B
Nix
41 lines
731 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.home-assistant = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
|
|
|
|
};
|
|
services.home-assistant.config = {
|
|
name = "Home - Rechberg";
|
|
unit_system = "metric";
|
|
};
|
|
|
|
my.homepage.services = [
|
|
{
|
|
group = "Home";
|
|
name = "Home Assistant";
|
|
description = "Home automation";
|
|
href = "http://${hostName}:8123";
|
|
icon = "si-homeassistant";
|
|
}
|
|
];
|
|
};
|
|
}
|