Adding vpnc configuration module
This commit is contained in:
parent
a3d0fcda13
commit
0667d67c95
41
nixos/modules/config/vpnc.nix
Normal file
41
nixos/modules/config/vpnc.nix
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
|||||||
./config/system-environment.nix
|
./config/system-environment.nix
|
||||||
./config/system-path.nix
|
./config/system-path.nix
|
||||||
./config/timezone.nix
|
./config/timezone.nix
|
||||||
|
./config/vpnc.nix
|
||||||
./config/unix-odbc-drivers.nix
|
./config/unix-odbc-drivers.nix
|
||||||
./config/users-groups.nix
|
./config/users-groups.nix
|
||||||
./config/zram.nix
|
./config/zram.nix
|
||||||
|
Loading…
Reference in New Issue
Block a user