config/modules/nixos/services/vpn/default.nix

35 lines
654 B
Nix
Raw Normal View History

2024-05-23 20:26:30 +00:00
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.vpn;
in {
options.services.vpn = with types; {
2024-05-23 21:24:09 +00:00
enable = mkBoolOpt false "Enable VPN service(s)";
2024-05-27 03:11:41 -04:00
mullvad = mkBoolOpt false "Enable Mullvad VPN Daemon";
2024-05-23 20:26:30 +00:00
};
config = mkIf cfg.enable {
2025-03-22 16:03:07 -04:00
services.mullvad-vpn = {
enable = cfg.mullvad;
package = nixos-stable.mullvad;
};
services.openvpn = {
servers = {
work = {
config = ''config /home/zoey/Downloads/zachary_myers.ovpn'';
updateResolvConf = true;
};
2024-05-23 20:26:30 +00:00
};
};
systemd.services.openvpn-work.wantedBy = lib.mkForce [];
2024-05-23 20:26:30 +00:00
};
}