0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-19 00:20:32 +03:00
nixpkgs/nixos/modules/programs/winbox.nix
Armin Mahdilou f1dc4ca736 winbox: add UDP port range
Wine needs to listen to UDP ports 40k to 50k. Winbox can
use these ports to discover and connect.

Signed-off-by: Armin Mahdilou <Armin.Mahdilou@gmail.com>
2025-06-24 23:29:31 +02:00

37 lines
754 B
Nix

{
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 {
environment.systemPackages = [ cfg.package ];
networking.firewall = lib.mkIf cfg.openFirewall {
allowedUDPPorts = [ 5678 ];
allowedUDPPortRanges = [
{
from = 40000;
to = 50000;
}
];
};
};
}