mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
34 lines
814 B
Nix
34 lines
814 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkDefault;
|
|
inherit (config.services) nginx zigbee2mqtt;
|
|
name.shortServer = mkDefault "z2m";
|
|
in {
|
|
config.services.nginx = {
|
|
virtualHosts = {
|
|
zigbee2mqtt = {
|
|
locations."/" = {
|
|
proxy.websocket.enable = true;
|
|
proxyPass = mkIf zigbee2mqtt.enable (
|
|
mkDefault "http://localhost:${toString zigbee2mqtt.settings.frontend.port}"
|
|
);
|
|
};
|
|
inherit name;
|
|
vouch.enable = true;
|
|
};
|
|
zigbee2mqtt'local = {
|
|
inherit name;
|
|
locations."/" = {
|
|
proxy.websocket.enable = true;
|
|
proxyPass = mkDefault (
|
|
nginx.virtualHosts.zigbee2mqtt.locations."/".proxyPass
|
|
);
|
|
};
|
|
local.enable = true;
|
|
};
|
|
};
|
|
};
|
|
}
|