mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 19:23:01 +03:00
quirks/wifi: Add quirk to disable MAC address randomization
This commit is contained in:
parent
ed9da448d7
commit
3a48ed5fa1
@ -3,5 +3,6 @@
|
||||
./exynos
|
||||
./qualcomm
|
||||
./framebuffer.nix
|
||||
./wifi.nix
|
||||
];
|
||||
}
|
||||
|
36
modules/quirks/wifi.nix
Normal file
36
modules/quirks/wifi.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user