{ 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 ]; }