broker: customize mqttui with username/password
This commit is contained in:
parent
7b5f6b388e
commit
df323b4dfa
|
@ -1,5 +1,12 @@
|
||||||
{ config, pkgs, lib, zentralwerk, ... }:
|
{ 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 = {
|
c3d2 = {
|
||||||
deployment = {
|
deployment = {
|
||||||
|
@ -60,8 +67,16 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
mqttui
|
mymqttui
|
||||||
];
|
];
|
||||||
|
|
||||||
|
users.motd = ''
|
||||||
|
C3D2 MQTT Broker
|
||||||
|
================
|
||||||
|
|
||||||
|
Use `mqttui` to inspect the data in mosquitto.
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
system.stateVersion = "22.05";
|
system.stateVersion = "22.05";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue