mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(exports): service access
This commit is contained in:
parent
91918b8061
commit
871b1c5b2d
69 changed files with 1317 additions and 509 deletions
|
|
@ -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"; }
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue