feat(exports): service access

This commit is contained in:
arcnmx 2024-02-19 17:34:39 -08:00
parent 91918b8061
commit 871b1c5b2d
69 changed files with 1317 additions and 509 deletions

View file

@ -1,9 +1,10 @@
{
config,
lib,
access,
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (lib.modules) mkDefault;
inherit (config.services) home-assistant nginx;
name.shortServer = mkDefault "home";
listen' = {
@ -24,8 +25,9 @@ in {
websocket.enable = true;
headers.enableRecommended = true;
};
proxyPass = mkIf home-assistant.enable (mkDefault
"http://localhost:${toString home-assistant.config.http.server_port}"
proxyPass = mkDefault (
if home-assistant.enable then "http://localhost:${toString home-assistant.config.http.server_port}"
else access.proxyUrlFor { serviceName = "home-assistant"; }
);
};
};