feat: several updates

This commit is contained in:
Xavier Morel
2025-12-09 14:35:20 +01:00
parent aec2e5bf63
commit a78704f30f
36 changed files with 826 additions and 150 deletions

49
containers/mqtt.nix Normal file
View File

@@ -0,0 +1,49 @@
{ ... }:
let
db_pass = import ../config/_passwords.nix;
in
{
my-lxc.mqtt = {
container = {
cores = 1;
memory = 512;
disk = "5G";
swap = 512;
};
system = {
additionalPorts = [
1883
9001
];
importConfig = [
../config/mqtt-mosquitto.nix
];
};
logging = {
enable = true;
metricsEnable = true;
prometheusPorts = {
mosquitto = 9000;
};
journalLoggers.mosquitto = ''
stage.regex {
expression = "^(?P<timestamp>\\d+): (?P<client_id>\\S+) (?P<message>.*)$"
}
stage.timestamp {
source = "timestamp"
format = "Unix"
}
stage.labels {
values = {
client_id = "",
}
}
stage.output {
source = "message"
}
'';
};
private = true; # available only on private lan
auth = true; # auth overlay
};
}