1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.networking.vpnc;
7 mkServiceDef = name: value:
8 {
9 name = "vpnc/${name}.conf";
10 value = { text = value; };
11 };
12
13in
14{
15 options = {
16 networking.vpnc = {
17 services = mkOption {
18 type = types.attrsOf types.str;
19 default = {};
20 example = {
21 test =
22 ''
23 IPSec gateway 192.168.1.1
24 IPSec ID someID
25 IPSec secret secretKey
26 Xauth username name
27 Xauth password pass
28 '';
29 };
30 description =
31 ''
32 The names of cisco VPNs and their associated definitions
33 '';
34 };
35 };
36 };
37
38 config.environment.etc = mapAttrs' mkServiceDef cfg.services;
39}
40
41