diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index 2d76e0676b2..79ddb5f7968 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -34,6 +34,8 @@ let [device] wifi.scan-rand-mac-address=${if cfg.wifi.scanRandMacAddress then "yes" else "no"} + ${optionalString (cfg.wifi.backend != null) + ''wifi.backend=${cfg.wifi.backend}''} ${cfg.extraConfig} ''; @@ -139,7 +141,7 @@ in { # Ugly hack for using the correct gnome3 packageSet basePackages = mkOption { type = types.attrsOf types.package; - default = { inherit networkmanager modemmanager wpa_supplicant + default = { inherit networkmanager modemmanager networkmanager-openvpn networkmanager-vpnc networkmanager-openconnect networkmanager-fortisslvpn networkmanager-l2tp networkmanager-iodine; }; @@ -194,6 +196,12 @@ in { wifi = { macAddress = macAddressOpt; + backend = mkOption { + type = types.enum ["wpa_supplicant" "iwd"]; + default = "wpa_supplicant"; + description = "WiFi Backend to be used by NetworkManager"; + }; + powersave = mkOption { type = types.nullOr types.bool; default = null; @@ -510,7 +518,9 @@ in { security.polkit.extraConfig = polkitConf; networking.networkmanager.packages = - mkIf cfg.enableStrongSwan [ pkgs.networkmanager_strongswan ]; + [ pkgs.${toString cfg.wifi.backend} ] ++ + optional cfg.enableStrongSwan [ pkgs.networkmanager_strongswan ]; + #mkIf cfg.enableStrongSwan [ pkgs.networkmanager_strongswan ]; services.dbus.packages = optional cfg.enableStrongSwan pkgs.strongswanNM ++ cfg.packages;