broker: customize mqttui with username/password

This commit is contained in:
Astro 2022-07-16 03:11:06 +02:00
parent 7b5f6b388e
commit df323b4dfa
1 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,12 @@
{ config, pkgs, lib, zentralwerk, ... }:
let
mymqttui = pkgs.writeScriptBin "mqttui" ''
export MQTTUI_USERNAME=consumer
export MQTTUI_PASSWORD=`cat ${(builtins.head config.services.mosquitto.listeners).users.consumer.passwordFile}`
exec ${pkgs.mqttui}/bin/mqttui
'';
in
{
c3d2 = {
deployment = {
@ -60,8 +67,16 @@
};
environment.systemPackages = with pkgs; [
mqttui
mymqttui
];
users.motd = ''
C3D2 MQTT Broker
================
Use `mqttui` to inspect the data in mosquitto.
'';
system.stateVersion = "22.05";
}