37 lines
1 KiB
Nix
37 lines
1 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options.services.home-assistant = {
|
|
domain = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "domain that home-assistant will be hosted at";
|
|
default = "home-assistant.arpa";
|
|
};
|
|
extraDomains = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
description = "extra domains that should be configured for home-assistant";
|
|
default = [];
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (config.services.reverseProxy.enable && config.services.home-assistant.enable) {
|
|
services.reverseProxy.services.home-assistant = {
|
|
target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}";
|
|
domain = config.services.home-assistant.domain;
|
|
extraDomains = config.services.home-assistant.extraDomains;
|
|
|
|
settings = {
|
|
proxyWebsockets.enable = true;
|
|
forwardHeaders.enable = true;
|
|
|
|
# Custom timeout settings
|
|
proxyHeaders = {
|
|
enable = true;
|
|
timeout = 90;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|