aboutsummaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-04-30 14:42:55 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-04-30 15:56:41 +0300
commit9be6c7b78f2a668aa1edcafa25c3dd1ba8ae6ad7 (patch)
tree8db0743d00f83406e38e2c2c192751c778fe54c9 /modules/system
parent49659d55878d09827566902d07d01f051926aff2 (diff)
downloadnixsap-9be6c7b78f2a668aa1edcafa25c3dd1ba8ae6ad7.tar.gz
(* BREAKING *) Avoid ambiguous options
"either foo (listOf foo)" was not very useful and interfered proper merging.
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/firewall.nix10
1 files changed, 5 insertions, 5 deletions
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)";