config/modules/services/hass/default.nix

40 lines
767 B
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 = [
{
subnets = myData.subnets.vpn.cidrs;
tcp = [myData.ports.hass];
}
];
services = {
home-assistant = {
enable = true;
extraComponents = [
"esphome"
"met"
"radio_browser"
];
config = {
auth_providers = {
trusted_networks = [myData.subnets.tailscale.cidr];
#trusted_proxies = ["127.0.0.1"];
};
default_config = {};
};
};
};
};
}