hass
This commit is contained in:
39
modules/services/hass/default.nix
Normal file
39
modules/services/hass/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
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 = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user