From 9be6c7b78f2a668aa1edcafa25c3dd1ba8ae6ad7 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 30 Apr 2017 14:42:55 +0300 Subject: (* BREAKING *) Avoid ambiguous options "either foo (listOf foo)" was not very useful and interfered proper merging. --- modules/system/firewall.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/system') diff --git a/modules/system/firewall.nix b/modules/system/firewall.nix index 289f635..ccd5750 100644 --- a/modules/system/firewall.nix +++ b/modules/system/firewall.nix @@ -2,14 +2,14 @@ let inherit (builtins) length toString replaceStrings; - inherit (lib) flatten concatMapStringsSep optionalString splitString mkOption; - inherit (lib.types) listOf int either submodule enum str; + inherit (lib) concatMapStringsSep optionalString splitString mkOption; + inherit (lib.types) listOf int submodule enum str; inherit (config.nixsap.system.firewall) whitelist; iptablesAllow = { dport, protocol, source, comment, ... }: let - ports = concatMapStringsSep "," toString (flatten [dport]); + ports = concatMapStringsSep "," toString dport; iptables = if 1 < length (splitString ":" source) then "ip6tables" else "iptables"; in "${iptables} -w -A nixos-fw -m multiport " @@ -24,8 +24,8 @@ in { type = listOf (submodule { options = { dport = mkOption { - description = "Destination port or list of ports"; - type = either int (listOf int); + description = "Destination ports"; + type = listOf int; }; source = mkOption { description = "Source specification: a network IP address (with optional /mask)"; -- cgit v1.2.3