2023-12-15 18:48:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.winbox;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.winbox = {
|
|
|
|
enable = lib.mkEnableOption ("MikroTik Winbox");
|
|
|
|
package = lib.mkPackageOption pkgs "winbox" { };
|
|
|
|
|
|
|
|
openFirewall = lib.mkOption {
|
|
|
|
description = ''
|
|
|
|
Whether to open ports for the MikroTik Neighbor Discovery protocol. Required for Winbox neighbor discovery.
|
|
|
|
'';
|
|
|
|
default = false;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-12-16 09:09:59 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2023-12-15 18:48:49 +00:00
|
|
|
networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ 5678 ];
|
|
|
|
};
|
|
|
|
}
|