mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
42 lines
757 B
Nix
42 lines
757 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
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 = {
|
|
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;
|
|
}
|
|
|
|
|