Files
Gebos/nix/hosts/mqtt-ingest.nix
T
Lars Nolden 58155dc737
check / flake-check (push) Successful in 25s
deploy / deploy (push) Successful in 48s
switch to emqx
2026-07-02 15:19:59 +02:00

32 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
{
networking.hostName = "mqtt-ingest";
services.gebos.secrets.ingester = true;
# Broker authn users (users.csv).
services.gebos.secrets.emqx = true;
# EMQX (official container image) terminates TLS on :8883 itself and serves
# the ingester on loopback :1883. Certs come from security.acme via HTTP-01
# (lego standalone on :80) — no Caddy on this host anymore.
services.gebos.emqx = {
enable = true;
domain = "ingest.gebos.online";
# 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 EMQX).
postgresUrl = "postgres://gebos_ingest@10.0.0.2:5432/postgres?sslmode=require";
# GEBOS_POSTGRES_PASSWORD sourced from /run/secrets/gebos-env (sops-nix).
};
# 8883: MQTTS for senders. 80: ACME HTTP-01 challenge (lego's standalone
# solver binds it during issuance/renewal; idle otherwise).
networking.firewall.allowedTCPPorts = [ 80 8883 ];
}