Loading nixos/modules/services/networking/networkmanager.nix +12 −7 Original line number Diff line number Diff line Loading @@ -11,7 +11,8 @@ let cfg = config.networking.networkmanager; ini = pkgs.formats.ini { }; delegateWireless = config.networking.wireless.enable == true && cfg.unmanaged != [ ]; # Whether wpa_supplicant is managed independently delegateWireless = config.networking.wireless.networks != { } && cfg.unmanaged != [ ]; enableIwd = cfg.wifi.backend == "iwd"; Loading Loading @@ -136,10 +137,7 @@ let cfg.package ] ++ cfg.plugins ++ pluginRuntimeDeps ++ lib.optionals (!delegateWireless && !enableIwd) [ pkgs.wpa_supplicant ]; ++ pluginRuntimeDeps; in { Loading Loading @@ -541,9 +539,9 @@ in assertions = [ { assertion = config.networking.wireless.enable == true -> cfg.unmanaged != [ ]; assertion = config.networking.wireless.networks != { } -> cfg.unmanaged != [ ]; message = '' You can not use networking.networkmanager with networking.wireless. You can not use networking.networkmanager with networking.wireless.networks. Except if you mark some interfaces as <literal>unmanaged</literal> by NetworkManager. ''; } Loading Loading @@ -676,6 +674,13 @@ in useDHCP = false; }) (mkIf (!delegateWireless && !enableIwd) { # Enable wpa_supplicant but fully control it over DBus wireless.enable = true; wireless.autoDetectInterfaces = false; wireless.dbusControlled = true; }) (mkIf enableIwd { wireless.iwd.enable = true; }) Loading nixos/modules/services/networking/wpa_supplicant.nix +13 −6 Original line number Diff line number Diff line Loading @@ -199,7 +199,12 @@ let script = '' iface_args="-s ${optionalString cfg.dbusControlled "-u"} -D${cfg.driver} ${configStr}" ${ if iface == null then if iface != null then '' # add known interface to the daemon arguments args="-i${iface} $iface_args" '' else if cfg.autoDetectInterfaces then '' # detect interfaces automatically Loading @@ -222,10 +227,7 @@ let done '' else '' # add known interface to the daemon arguments args="-i${iface} $iface_args" '' "args=$iface_args" } # finally start daemon Loading @@ -251,7 +253,8 @@ in "wlan1" ]; description = '' The interfaces {command}`wpa_supplicant` will use. If empty, it will The interfaces {command}`wpa_supplicant` will use. If empty and [](#opt-networking.wireless.autoDetectInterfaces) is true it will automatically use all wireless interfaces. ::: {.note} Loading @@ -260,6 +263,10 @@ in ''; }; autoDetectInterfaces = mkEnableOption "automatic detection of wireless interfaces" // { default = true; }; driver = mkOption { type = types.str; default = "nl80211,wext"; Loading Loading
nixos/modules/services/networking/networkmanager.nix +12 −7 Original line number Diff line number Diff line Loading @@ -11,7 +11,8 @@ let cfg = config.networking.networkmanager; ini = pkgs.formats.ini { }; delegateWireless = config.networking.wireless.enable == true && cfg.unmanaged != [ ]; # Whether wpa_supplicant is managed independently delegateWireless = config.networking.wireless.networks != { } && cfg.unmanaged != [ ]; enableIwd = cfg.wifi.backend == "iwd"; Loading Loading @@ -136,10 +137,7 @@ let cfg.package ] ++ cfg.plugins ++ pluginRuntimeDeps ++ lib.optionals (!delegateWireless && !enableIwd) [ pkgs.wpa_supplicant ]; ++ pluginRuntimeDeps; in { Loading Loading @@ -541,9 +539,9 @@ in assertions = [ { assertion = config.networking.wireless.enable == true -> cfg.unmanaged != [ ]; assertion = config.networking.wireless.networks != { } -> cfg.unmanaged != [ ]; message = '' You can not use networking.networkmanager with networking.wireless. You can not use networking.networkmanager with networking.wireless.networks. Except if you mark some interfaces as <literal>unmanaged</literal> by NetworkManager. ''; } Loading Loading @@ -676,6 +674,13 @@ in useDHCP = false; }) (mkIf (!delegateWireless && !enableIwd) { # Enable wpa_supplicant but fully control it over DBus wireless.enable = true; wireless.autoDetectInterfaces = false; wireless.dbusControlled = true; }) (mkIf enableIwd { wireless.iwd.enable = true; }) Loading
nixos/modules/services/networking/wpa_supplicant.nix +13 −6 Original line number Diff line number Diff line Loading @@ -199,7 +199,12 @@ let script = '' iface_args="-s ${optionalString cfg.dbusControlled "-u"} -D${cfg.driver} ${configStr}" ${ if iface == null then if iface != null then '' # add known interface to the daemon arguments args="-i${iface} $iface_args" '' else if cfg.autoDetectInterfaces then '' # detect interfaces automatically Loading @@ -222,10 +227,7 @@ let done '' else '' # add known interface to the daemon arguments args="-i${iface} $iface_args" '' "args=$iface_args" } # finally start daemon Loading @@ -251,7 +253,8 @@ in "wlan1" ]; description = '' The interfaces {command}`wpa_supplicant` will use. If empty, it will The interfaces {command}`wpa_supplicant` will use. If empty and [](#opt-networking.wireless.autoDetectInterfaces) is true it will automatically use all wireless interfaces. ::: {.note} Loading @@ -260,6 +263,10 @@ in ''; }; autoDetectInterfaces = mkEnableOption "automatic detection of wireless interfaces" // { default = true; }; driver = mkOption { type = types.str; default = "nl80211,wext"; Loading