summary refs log tree commit diff
path: root/nixos/modules/services/networking/openvpn.nix
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-09-11 18:35:23 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-09-13 12:53:11 +0900
commit8d58771b94d41b1d0347e7c4c92c54073abc28ad (patch)
tree62637c607a84af69a4fbbbe544db4bc277fcded6 /nixos/modules/services/networking/openvpn.nix
parent775d98acbc41bdaf2fa2a3bbed1fefcd79371fd2 (diff)
downloadnixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar.gz
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar.bz2
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar.lz
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar.xz
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.tar.zst
nixpkgs-8d58771b94d41b1d0347e7c4c92c54073abc28ad.zip
openvpn module: optionSet -> submodule
Diffstat (limited to 'nixos/modules/services/networking/openvpn.nix')
-rw-r--r--nixos/modules/services/networking/openvpn.nix78
1 files changed, 40 insertions, 38 deletions
diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix
index 82173a841a3..8ee86ea863e 100644
--- a/nixos/modules/services/networking/openvpn.nix
+++ b/nixos/modules/services/networking/openvpn.nix
@@ -116,52 +116,54 @@ in
         attribute name.
       '';
 
-      type = types.attrsOf types.optionSet;
+      type = with types; attrsOf (submodule {
 
-      options = {
+        options = {
 
-        config = mkOption {
-          type = types.lines;
-          description = ''
-            Configuration of this OpenVPN instance.  See
-            <citerefentry><refentrytitle>openvpn</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-            for details.
-          '';
-        };
+          config = mkOption {
+            type = types.lines;
+            description = ''
+              Configuration of this OpenVPN instance.  See
+              <citerefentry><refentrytitle>openvpn</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+              for details.
+            '';
+          };
 
-        up = mkOption {
-          default = "";
-          type = types.lines;
-          description = ''
-            Shell commands executed when the instance is starting.
-          '';
-        };
+          up = mkOption {
+            default = "";
+            type = types.lines;
+            description = ''
+              Shell commands executed when the instance is starting.
+            '';
+          };
 
-        down = mkOption {
-          default = "";
-          type = types.lines;
-          description = ''
-            Shell commands executed when the instance is shutting down.
-          '';
-        };
+          down = mkOption {
+            default = "";
+            type = types.lines;
+            description = ''
+              Shell commands executed when the instance is shutting down.
+            '';
+          };
 
-        autoStart = mkOption {
-          default = true;
-          type = types.bool;
-          description = "Whether this OpenVPN instance should be started automatically.";
-        };
+          autoStart = mkOption {
+            default = true;
+            type = types.bool;
+            description = "Whether this OpenVPN instance should be started automatically.";
+          };
+
+          updateResolvConf = mkOption {
+            default = false;
+            type = types.bool;
+            description = ''
+              Use the script from the update-resolv-conf package to automatically
+              update resolv.conf with the DNS information provided by openvpn. The
+              script will be run after the "up" commands and before the "down" commands.
+            '';
+          };
 
-        updateResolvConf = mkOption {
-          default = false;
-          type = types.bool;
-          description = ''
-            Use the script from the update-resolv-conf package to automatically
-            update resolv.conf with the DNS information provided by openvpn. The
-            script will be run after the "up" commands and before the "down" commands.
-          '';
         };
 
-      };
+      });
 
     };