summary refs log tree commit diff
path: root/nixos/modules/config/vpnc.nix
blob: 356e007c0a3e94663bc58a8481a762def4e46a83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ config, lib, ... }:

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 = literalExample ''
         { 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;
}