mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(mosquitto): move to utsuho
This commit is contained in:
parent
5658105812
commit
d6b8883c24
15 changed files with 218 additions and 95 deletions
|
|
@ -1,10 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
gensokyo-zone,
|
||||
access,
|
||||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mkAlmostDefault;
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
cfg = config.services.zigbee2mqtt;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
in {
|
||||
sops.secrets.z2m-secret = {
|
||||
sopsFile = mkDefault ./secrets/zigbee2mqtt.yaml;
|
||||
|
|
@ -23,8 +26,11 @@ in {
|
|||
mqtt = {
|
||||
user = "z2m";
|
||||
password = "!secret z2m_pass";
|
||||
server = mkIf (!config.services.mosquitto.enable) (
|
||||
mkDefault "mqtt://mqtt.local.${config.networking.domain}:1883"
|
||||
server = let
|
||||
utsuho = access.nixosFor "utsuho";
|
||||
mqttHost = access.getHostnameFor "utsuho" "lan";
|
||||
in mkIf (!config.services.mosquitto.enable) (
|
||||
assert utsuho.services.mosquitto.enable; mkAlmostDefault "mqtt://${mqttHost}:1883"
|
||||
);
|
||||
};
|
||||
homeassistant = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue