nixos/iperf: add openFirewall setting
Opens the specified tcp port.
This commit is contained in:
parent
e6b6815b26
commit
2ebeba4927
|
@ -19,6 +19,11 @@ let
|
||||||
default = null;
|
default = null;
|
||||||
description = "Bind to the specific interface associated with the given address.";
|
description = "Bind to the specific interface associated with the given address.";
|
||||||
};
|
};
|
||||||
|
openFirewall = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Open ports in the firewall for iperf3.";
|
||||||
|
};
|
||||||
verbose = mkOption {
|
verbose = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -52,6 +57,11 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
imp = {
|
imp = {
|
||||||
|
|
||||||
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
|
allowedTCPPorts = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.iperf3 = {
|
systemd.services.iperf3 = {
|
||||||
description = "iperf3 daemon";
|
description = "iperf3 daemon";
|
||||||
unitConfig.Documentation = "man:iperf3(1) https://iperf.fr/iperf-doc.php";
|
unitConfig.Documentation = "man:iperf3(1) https://iperf.fr/iperf-doc.php";
|
||||||
|
|
Loading…
Reference in New Issue