1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 04:51:31 +03:00
mobile-nixos/modules/quirks/wifi.nix

37 lines
1.0 KiB
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkOption types mkMerge mkIf;
cfg = config.mobile.quirks;
in
{
options.mobile.quirks.wifi = {
disableMacAddressRandomization = mkOption {
type = types.bool;
default = false;
description = ''
Disables MAC address randomization.
This may be required by some hardware or drivers, or combination.
When the feature is enabled (quirk disabled) it may cause the wifi
interface to disappear when enabled, as long as Network Manager is
active.
'';
};
};
config = mkIf cfg.wifi.disableMacAddressRandomization {
environment.etc."NetworkManager/conf.d/30-mac-randomization.conf" = {
source = pkgs.writeText "30-mac-randomization.conf" ''
[device-mac-randomization]
wifi.scan-rand-mac-address=no
[connection-mac-randomization]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve
'';
target = "NetworkManager/conf.d/30-mac-randomization.conf";
};
};
}