2022-09-29 13:08:33 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-08-31 04:56:04 +00:00
|
|
|
|
|
|
|
{
|
2022-09-28 12:25:34 +00:00
|
|
|
# the default backend is "wpa_supplicant".
|
|
|
|
# wpa_supplicant reliably picks weak APs to connect to.
|
|
|
|
# see: <https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/474>
|
2022-09-29 10:33:48 +00:00
|
|
|
# iwd is an alternative that shouldn't have this problem
|
|
|
|
# docs:
|
|
|
|
# - <https://nixos.wiki/wiki/Iwd>
|
|
|
|
# - <https://iwd.wiki.kernel.org/networkmanager>
|
2022-10-24 07:25:19 +00:00
|
|
|
# - `man iwd.config` for global config
|
|
|
|
# - `man iwd.network` for per-SSID config
|
2022-09-29 10:33:48 +00:00
|
|
|
# use `iwctl` to control
|
2022-09-29 13:08:33 +00:00
|
|
|
networking.networkmanager.wifi.backend = "iwd";
|
2022-10-24 07:25:19 +00:00
|
|
|
networking.wireless.iwd.enable = true;
|
|
|
|
networking.wireless.iwd.settings = {
|
|
|
|
# auto-connect to a stronger network if signal drops below this value
|
|
|
|
# bedroom -> bedroom connection is -35 to -40 dBm
|
|
|
|
# bedroom -> living room connection is -60 dBm
|
|
|
|
General.RoamThreshold = "-52"; # default -70
|
|
|
|
General.RoamThreshold5G = "-52"; # default -76
|
|
|
|
};
|
2022-08-31 04:56:04 +00:00
|
|
|
}
|