From 0667d67c9540604738c8d5c5a5c872e70bcf2b3b Mon Sep 17 00:00:00 2001 From: Sam Griffin Date: Wed, 20 Aug 2014 22:57:41 -0400 Subject: Adding vpnc configuration module --- nixos/modules/config/vpnc.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 nixos/modules/config/vpnc.nix (limited to 'nixos/modules/config/vpnc.nix') diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix new file mode 100644 index 000000000000..956a4c7d3fdb --- /dev/null +++ b/nixos/modules/config/vpnc.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.networking.vpnc; + mkServiceDef = name: value: + { + source = builtins.toFile "${name}.conf" value; + target = "vpnc/${name}.conf"; + }; + +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 = mapAttrsToList mkServiceDef cfg.services; +} + + -- cgit 1.4.1