at 18.09-beta 782 B view raw
1{ config, lib, ... }: 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 = literalExample '' 21 { test = ''' 22 IPSec gateway 192.168.1.1 23 IPSec ID someID 24 IPSec secret secretKey 25 Xauth username name 26 Xauth password pass 27 '''; 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