mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-19 00:20:32 +03:00

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>
37 lines
754 B
Nix
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;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|