{ config, lib, pkgs, ... }: let cfg = config.services.gebos.hivemq; in { options.services.gebos.hivemq = { enable = lib.mkEnableOption "HiveMQ CE single-node broker"; persistentSessions = lib.mkOption { type = lib.types.bool; default = true; }; tlsPort = lib.mkOption { type = lib.types.port; default = 8883; }; }; config = lib.mkIf cfg.enable { # TODO: package HiveMQ CE (download tarball + JRE wrapper) and wire as a # systemd unit. Until then this module only declares options so dependent # hosts can be evaluated. systemd.services.gebos-hivemq = { description = "HiveMQ CE"; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.coreutils}/bin/true"; # TODO: real HiveMQ command Restart = "on-failure"; }; }; }; }