mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Network] add option to enable many types of VPN support to NetworkManager
This commit is contained in:
parent
0bc9e4cf9e
commit
b37f09f519
1 changed files with 11 additions and 3 deletions
14
network.nix
14
network.nix
|
|
@ -24,6 +24,7 @@ in
|
|||
description = "Set network DNS";
|
||||
type = types.enum [ "systemd-resolved" "dnsmasq" "unbound" "none" "default" ];
|
||||
};
|
||||
vpnSupport = mkEnableOption "VPN support of many kinds in NetworkManager" // { default = desktopCfg.enable; };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -58,9 +59,16 @@ in
|
|||
networking.networkmanager = {
|
||||
wifi.backend = mkDefault "iwd";
|
||||
dns = mkDefault cfg.dns;
|
||||
plugins = with pkgs; concatLists [
|
||||
(optional (cfg.dns == "dnsmasq") dnsmasq)
|
||||
];
|
||||
plugins = with pkgs; []
|
||||
++ optional (cfg.dns == "dnsmasq") dnsmasq
|
||||
++ optionals cfg.vpnSupport [
|
||||
networkmanager_strongswan
|
||||
networkmanager-openvpn
|
||||
networkmanager-openconnect
|
||||
networkmanager-sstp
|
||||
networkmanager-l2tp
|
||||
]
|
||||
;
|
||||
};
|
||||
networking.wireless.enable = (cfg.backend != "NetworkManager");
|
||||
networking.wireless.iwd.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue