mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
22 lines
461 B
Nix
22 lines
461 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf mkEnableOption mkOption;
|
|
cfg = config.services.zigbee2mqtt;
|
|
in {
|
|
options.services.zigbee2mqtt = with lib.types; {
|
|
openFirewall = mkEnableOption "firewall port";
|
|
domain = mkOption {
|
|
type = str;
|
|
default = config.networking.domain;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
networking.firewall.allowedTCPPorts = mkIf (cfg.enable && cfg.openFirewall) [
|
|
cfg.settings.frontend.port
|
|
];
|
|
};
|
|
}
|