mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
34 lines
717 B
Nix
34 lines
717 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; {
|
|
options.elss.openvpn.enable = mkEnableOption "Setup TUD openvpn";
|
|
config = let
|
|
cfg = config.elss.openvpn;
|
|
in
|
|
mkIf cfg.enable {
|
|
services.openvpn.servers = {
|
|
TUD_full = {
|
|
config = "config ${config.sops.secrets.TUD_VPN_full.path}";
|
|
autoStart = false;
|
|
};
|
|
|
|
TUD_split = {
|
|
config = "config ${config.sops.secrets.TUD_VPN_split.path}";
|
|
autoStart = false;
|
|
};
|
|
};
|
|
sops.secrets = {
|
|
"TUD_VPN_full" = {
|
|
sopsFile = ../../secrets/networks.yaml;
|
|
};
|
|
"TUD_VPN_split" = {
|
|
sopsFile = ../../secrets/networks.yaml;
|
|
};
|
|
};
|
|
};
|
|
}
|