config/modules/services/hass/default.nix

53 lines
1.0 KiB
Nix
Raw Normal View History

2023-11-14 09:01:02 +02:00
{
config,
lib,
myData,
...
}: let
cfg = config.mj.services.hass;
in {
options.mj.services.hass = with lib.types; {
enable = lib.mkEnableOption "Enable home-assistant";
};
config = lib.mkIf cfg.enable {
mj.services.friendlyport.ports = [
{
2023-11-14 09:01:02 +02:00
subnets = [myData.subnets.tailscale.cidr];
2023-11-14 09:01:02 +02:00
tcp = [myData.ports.hass];
}
];
services = {
home-assistant = {
enable = true;
extraComponents = [
"esphome"
"met"
"radio_browser"
2023-11-14 09:01:02 +02:00
# my stuff
"yamaha_musiccast"
"dlna_dmr"
2023-11-14 10:07:52 +02:00
"shelly"
2023-11-14 09:01:02 +02:00
];
config = {
default_config = {};
2023-11-14 09:01:02 +02:00
http = {
use_x_forwarded_for = true;
trusted_proxies = ["127.0.0.1"];
};
homeassistant = {
auth_providers = [
{
type = "trusted_networks";
trusted_networks = [myData.subnets.tailscale.cidr];
}
];
};
2023-11-14 09:01:02 +02:00
};
};
};
};
}