mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 23:36:17 +01:00
41 lines
782 B
Nix
41 lines
782 B
Nix
{ 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;
|
|
}
|
|
|
|
|