Files
nixos-blueprint/modules/nixos/system/wireless/wifi.nix
2025-04-28 22:53:03 +03:00

30 lines
580 B
Nix

{
lib,
config,
...
}:
with lib; let
cfg = config.wireless.wifi;
in {
options = {
wireless.wifi.enable =
mkEnableOption "enables wifi with iwd and MAC address randomisation";
};
config = mkIf cfg.enable {
networking = {
networkmanager.wifi = {
backend = "iwd";
macAddress = "random";
scanRandMacAddress = true;
};
wireless.iwd = {
enable = true;
settings = {
General.AddressRandomization = "network";
Settings.AlwaysRandomizeAddress = true;
};
};
};
};
}