summary refs log tree commit diff
path: root/nixos/modules/config/vpnc.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/config/vpnc.nix')
-rw-r--r--nixos/modules/config/vpnc.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix
new file mode 100644
index 00000000000..68d755232eb
--- /dev/null
+++ b/nixos/modules/config/vpnc.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.networking.vpnc;
+  mkServiceDef = name: value:
+    {
+      name = "vpnc/${name}.conf";
+      value = { text = value; };
+    };
+
+in
+{
+  options = {
+    networking.vpnc = {
+      services = mkOption {
+       type = types.attrsOf types.str;
+       default = {};
+       example = {
+         test = 
+          ''
+           IPSec gateway 192.168.1.1 
+           IPSec ID someID
+           IPSec secret secretKey
+           Xauth username name
+           Xauth password pass
+          '';
+       };
+       description = 
+         ''
+           The names of cisco VPNs and their associated definitions
+         '';
+      };
+    };
+  };
+
+  config.environment.etc = mapAttrs' mkServiceDef cfg.services;
+}
+
+