nixos/networkmanager: support stable-ssid for cloned MAC addresses
This commit is contained in:
parent
6c7e80886c
commit
e1863b4f79
1 changed files with 19 additions and 3 deletions
|
@ -101,7 +101,23 @@ let
|
|||
pre-down = "pre-down.d/";
|
||||
};
|
||||
|
||||
macAddressOpt = mkOption {
|
||||
macAddressOptWifi = mkOption {
|
||||
type = types.either types.str (types.enum [ "permanent" "preserve" "random" "stable" "stable-ssid" ]);
|
||||
default = "preserve";
|
||||
example = "00:11:22:33:44:55";
|
||||
description = lib.mdDoc ''
|
||||
Set the MAC address of the interface.
|
||||
|
||||
- `"XX:XX:XX:XX:XX:XX"`: MAC address of the interface
|
||||
- `"permanent"`: Use the permanent MAC address of the device
|
||||
- `"preserve"`: Don’t change the MAC address of the device upon activation
|
||||
- `"random"`: Generate a randomized value upon each connect
|
||||
- `"stable"`: Generate a stable, hashed MAC address
|
||||
- `"stable-ssid"`: Generate a stable MAC addressed based on Wi-Fi network
|
||||
'';
|
||||
};
|
||||
|
||||
macAddressOptEth = mkOption {
|
||||
type = types.either types.str (types.enum [ "permanent" "preserve" "random" "stable" ]);
|
||||
default = "preserve";
|
||||
example = "00:11:22:33:44:55";
|
||||
|
@ -258,10 +274,10 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
ethernet.macAddress = macAddressOpt;
|
||||
ethernet.macAddress = macAddressOptEth;
|
||||
|
||||
wifi = {
|
||||
macAddress = macAddressOpt;
|
||||
macAddress = macAddressOptWifi;
|
||||
|
||||
backend = mkOption {
|
||||
type = types.enum [ "wpa_supplicant" "iwd" ];
|
||||
|
|
Loading…
Reference in a new issue