nixos/firewall: canonicalize firewall ports lists

Fixes #56086.
This commit is contained in:
Pierre Bourdon 2019-03-09 19:59:01 +01:00
parent 843215ac1c
commit 18bc8203a1
No known key found for this signature in database
GPG Key ID: 6FB80DCD84DA0F1C

View File

@ -261,10 +261,14 @@ let
fi
'';
canonicalizePortList =
ports: lib.unique (builtins.sort builtins.lessThan ports);
commonOptions = {
allowedTCPPorts = mkOption {
type = types.listOf types.port;
default = [ ];
apply = canonicalizePortList;
example = [ 22 80 ];
description =
''
@ -287,6 +291,7 @@ let
allowedUDPPorts = mkOption {
type = types.listOf types.port;
default = [ ];
apply = canonicalizePortList;
example = [ 53 ];
description =
''