15 lines
318 B
Nix
15 lines
318 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.services.mosquitto;
|
|
in
|
|
{
|
|
options = {
|
|
services.mosquitto = {
|
|
openFirewall = lib.mkEnableOption "Open firewall port for Mosquitto";
|
|
};
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
networking.firewall.allowedTCPPorts = map ({ port, ... }: port) cfg.listeners;
|
|
};
|
|
}
|