nixos/networkmanager: support stable-ssid for cloned MAC addresses

This commit is contained in:
Maxine Aubrey 2024-02-14 22:42:40 +01:00
parent 6c7e80886c
commit e1863b4f79
No known key found for this signature in database
GPG key ID: F6FE033DFCB899F7

View file

@ -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"`: Dont 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" ];