about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSam Griffin <sam.griffin@gmail.com>2014-08-20 22:57:41 -0400
committerSam Griffin <sam.griffin@gmail.com>2014-08-31 12:44:13 -0400
commit0667d67c9540604738c8d5c5a5c872e70bcf2b3b (patch)
treee8327551b8f416d74aff91d93a1b2ebcce136260 /nixos
parenta3d0fcda139d42f0cd72e00bef90d3d94f77ccb6 (diff)
downloadnixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar.gz
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar.bz2
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar.lz
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar.xz
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.tar.zst
nixlib-0667d67c9540604738c8d5c5a5c872e70bcf2b3b.zip
Adding vpnc configuration module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/vpnc.nix41
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 42 insertions, 0 deletions
diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix
new file mode 100644
index 000000000000..956a4c7d3fdb
--- /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:
+    {
+      source = builtins.toFile "${name}.conf" value;
+      target = "vpnc/${name}.conf";
+    };
+
+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 = mapAttrsToList mkServiceDef cfg.services;
+}
+
+
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 6754c8a4f1a6..297ca0d1be44 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -21,6 +21,7 @@
   ./config/system-environment.nix
   ./config/system-path.nix
   ./config/timezone.nix
+  ./config/vpnc.nix
   ./config/unix-odbc-drivers.nix
   ./config/users-groups.nix
   ./config/zram.nix