diff --git a/nix/networks/list.nix b/nix/networks/list.nix index aaeb1560..30401b42 100644 --- a/nix/networks/list.nix +++ b/nix/networks/list.nix @@ -81,6 +81,13 @@ in hasPassword = true; randomizeMac = true; } + { + ssid = "LouisaCoffee"; + bssid = "fa:92:bf:62:7c:19"; + priority = privatePriority; + hasPassword = true; + randomizeMac = true; + } { ssid = "MetroTaipei x Louisa"; # 大安 priority = privatePriority; diff --git a/nix/networks/wpa_supplicant-compat.nix b/nix/networks/wpa_supplicant-compat.nix index 84f59504..2f57b267 100644 --- a/nix/networks/wpa_supplicant-compat.nix +++ b/nix/networks/wpa_supplicant-compat.nix @@ -20,28 +20,32 @@ let randomizeMac ? false, ... }: - let - uniqueKey = "${ssid}${lib.optionalString (bssid != null) bssid}"; - in { - ${uniqueKey} # we use a unique key here to make sure no "same ssid different bssid" networks collide in key. - = - lib.mkMerge [ - (builtins.removeAttrs networkArgs [ - "hasPassword" - "scanOnLowSignal" - "randomizeMac" - ]) - (lib.optionalAttrs hasPassword { - pskRaw = "ext:${escapePwdKey uniqueKey}"; # this implies changing the external password key if you set a bssid! - }) - { - extraConfig = '' - ${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""} - ${lib.optionalString randomizeMac "mac_addr=1"} - ''; - } - ]; + ${ + # We use a unique key here to make sure no "same ssid different bssid" networks collide in key. + # This is ordered, we still show "null" so that it would come after hex characters [a-z0-9]. + # The serialization is based on string order. + "${ssid},${if bssid != null then bssid else "null"}" + } = + lib.mkMerge [ + (builtins.removeAttrs networkArgs [ + "hasPassword" + "scanOnLowSignal" + "randomizeMac" + ]) + (lib.optionalAttrs hasPassword { + pskRaw = "ext:${ + # this implies changing the external password key if you set a bssid! + escapePwdKey (if bssid == null then ssid else "${ssid},${bssid}") + }"; + }) + { + extraConfig = '' + ${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""} + ${lib.optionalString randomizeMac "mac_addr=1"} + ''; + } + ]; }; in ns: lib.mkMerge (map go ns) diff --git a/nix/secrets/wpa_password.age b/nix/secrets/wpa_password.age index 511c4742..3a79d0bc 100644 Binary files a/nix/secrets/wpa_password.age and b/nix/secrets/wpa_password.age differ