summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-09-11 18:05:05 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-09-13 12:53:10 +0900
commitc3bdee3c397598a93276a52bd6bdc495fef18cb0 (patch)
tree492788a0409eb373b068e966291373304d418ed8 /nixos
parent1b3c03b49cb9739ec21b1dd7eacafd2bc671604c (diff)
downloadnixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar.gz
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar.bz2
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar.lz
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar.xz
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.tar.zst
nixlib-c3bdee3c397598a93276a52bd6bdc495fef18cb0.zip
nat module: optionSet -> submodule
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/nat.nix30
1 files changed, 15 insertions, 15 deletions
diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix
index 9d163e60d5ea..a0cfc8f8fb94 100644
--- a/nixos/modules/services/networking/nat.nix
+++ b/nixos/modules/services/networking/nat.nix
@@ -122,23 +122,23 @@ in
     };
 
     networking.nat.forwardPorts = mkOption {
-      type = types.listOf types.optionSet;
+      type = with types; listOf (submodule {
+        options = {
+          sourcePort = mkOption {
+            type = types.int;
+            example = 8080;
+            description = "Source port of the external interface";
+          };
+
+          destination = mkOption {
+            type = types.str;
+            example = "10.0.0.1:80";
+            description = "Forward tcp connection to destination ip:port";
+          };
+        };
+      });
       default = [];
       example = [ { sourcePort = 8080; destination = "10.0.0.1:80"; } ];
-      options = {
-        sourcePort = mkOption {
-          type = types.int;
-          example = 8080;
-          description = "Source port of the external interface";
-        };
-
-        destination = mkOption {
-          type = types.str;
-          example = "10.0.0.1:80";
-          description = "Forward tcp connection to destination ip:port";
-        };
-      };
-
       description =
         ''
           List of forwarded ports from the external interface to