Files
Gebos/nix/hosts/mqtt-ingest.nix
T
2026-06-26 16:12:57 +02:00

32 lines
846 B
Nix

{ config, lib, pkgs, ... }:
{
networking.hostName = "mqtt-ingest";
services.gebos.secrets.ingester = true;
services.gebos.hivemq = {
enable = true;
# Persistent sessions on disk — single-node, devices reconnect on restart.
persistentSessions = true;
tlsPort = 8883;
};
services.gebos.ingester = {
enable = true;
# mqttBroker defaults to tcp://127.0.0.1:1883 (the local HiveMQ).
postgresUrl = "postgres://gebos_ingest@10.0.0.2:5432/postgres?sslmode=require";
# GEBOS_POSTGRES_PASSWORD sourced from /run/secrets/gebos-env (sops-nix).
};
# Caddy fronts TLS for `ingest.gebos.online` and forwards to HiveMQ.
services.gebos.caddy = {
enable = true;
sites = {
"ingest.gebos.online" = { tcpProxy = "127.0.0.1:8883"; };
};
};
networking.firewall.allowedTCPPorts = [ 8883 ];
}