diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix new file mode 100644 index 000000000000..e79e4d1c20f8 --- /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: + { + 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; +} + + diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6754c8a4f1a6..297ca0d1be44 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -21,6 +21,7 @@ ./config/system-environment.nix ./config/system-path.nix ./config/timezone.nix + ./config/vpnc.nix ./config/unix-odbc-drivers.nix ./config/users-groups.nix ./config/zram.nix