Repository navigation
Carry saved Wi-Fi networks over to iwd - #640
Closed
oliverlukschander wants to merge 1 commit into
Closed
oliverlukschander wants to merge 1 commit into
oliverlukschander wants to merge 1 commit into
Conversation
omarchy-mac runs NetworkManager on the iwd backend, and on a Mac that ran wpa_supplicant before, every saved network then fails as a wrong password. NetworkManager writes an iwd profile only for a connection created while it runs on iwd. When iwd asks for the key of a WPA-PSK connection NetworkManager has used before, it does not hand over the key it stores but requests a new one from a secret agent (nm_device_iwd_agent_query in nm-device-iwd.c sets REQUEST_NEW once the connection has a timestamp), and Omarchy runs no agent. System setup on the live machine runs before the backend applies at NetworkManager's next start. It now gives iwd a profile for each saved WPA-PSK or SAE network whose key NetworkManager stores, in the format NetworkManager writes for a new connection (nm_wifi_utils_connection_to_iwd_config in nm-wifi-utils.c): the same file name, the passphrase or pre-shared key, and AutoConnect and Hidden. Like NetworkManager, it leaves out connections limited to some users, and it keeps any profile iwd already has. Verified on an M2 Pro (MacBook Pro 16"): after the switch the saved networks read as a wrong password, and with the carried-over profiles they connected without asking for a password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oliverlukschander
force-pushed
the
fix/iwd-saved-networks
branch
from
September 28, 2026 11:03
3f82914 to
7cd7065
Compare
Member
|
Thanks, this is still wanted. This week the Mac code moved into the omarchy-mac package ( |
Author
|
Thanks, happy to hear, rebase is done. |
Author
|
Closing: this was ported to the packages repo as omacom/omarchy-mac-pkgs#1 and merged there on 4 October (thanks @maralcbr). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
20-omarchy-mac-wifi.conf). On a Mac that ran wpa_supplicant before, every saved Wi-Fi network then fails after the next boot, and the network panel shows "Wrong password" whatever is typed.connection_addedinnm-iwd-manager.c). Networks saved under wpa_supplicant have none in/var/lib/iwd, so iwd asks NetworkManager's agent for the key.nm_device_iwd_agent_queryinnm-device-iwd.c(NM 1.58.1) setsNM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEWonce the connection has a timestamp and asks a secret agent for a new key. Omarchy runs no agent, so the log showsneed-auth (reason 'no-secrets'), thenNo agents were available, thennet.connman.iwd.Aborted.lib/wifi-iwd-profiles, gives iwd a profile for each saved infrastructure WPA-PSK or SAE network whose key NetworkManager stores.nm_wifi_utils_connection_to_iwd_configinnm-wifi-utils.c): the same file name (the SSID, or=plus hex),PassphraseorPreSharedKey, andAutoConnect=false/Hidden=truewhere set.omarchy-mac-setup-systemcalls it on the live machine. Setup runs from provisioning, first run and the transition migrations while NetworkManager still runs the old backend, so the profiles are in place before the switch applies at NetworkManager's next start. Running it again later also repairs a machine that already switched.Testing
On hardware. MacBook Pro 16" M2 Pro, NetworkManager 1.58.1, iwd 3.12, moved from wpa_supplicant to quattro-upstream:
Tests.
test/wifi-profiles-test.shcovers:Passphrasevs 64-hexPreSharedKey, and SAE;Hidden/AutoConnect=false;The nmcli stub reproduces
<hidden>without--show-secretsand nmcli's:/\escaping without--escape no, so the helper can't silently depend on either.packages/omarchy-mac/test/all: 81/81 pass (76 before), and the setup-test live harness passes. Rebased ontoquattro-upstream351c9fb (2026-09-28), only the README sentence needed resolving: 98/98 pass (93 before), and the runtime suite fails exactly as on an unmodified 351c9fb. Deliberately breaking the helper or its call in setup-system (23 mutations) failed the suite every time.Three small changes came after the hardware run: the platform check that
test/platform-test.shrequires of everylib/*helper,grep -x … >/dev/nullinstead ofgrep -qunder pipefail, and skipping permission-limited connections. None touches the tested path, and a dry run of the final helper against the same machine's real profiles wrote identical files.A second finding, not changed here
With iwd's autoconnect (NetworkManager's default
wifi.iwd.autoconnect=yes), NetworkManager follows iwd's connection by picking the first saved profile with the same SSID and security type (mirror_connection/nm_iwd_manager_get_ap_mirror_connection). It doesn't check that the profile is usable on the device.The machine above also had an older duplicate profile for the home network, from install day, bound to
interface-name=wld0; the interface iswlan0. NetworkManager picked it, and then:NetworkManager then disconnects iwd, and nothing reconnects.
wifi.iwd.autoconnect=no(NetworkManager then connects itself and respects profile availability, as under wpa_supplicant). Each connected within 0.5 s.wifi.iwd.autoconnect=noin20-omarchy-mac-wifi.confwould sidestep it for migrated machines with such leftovers, but it's a policy change, so it isn't part of this PR. I don't know where thewld0profile came from; nothing in this repo names that interface.Found while moving my own M2 Pro onto quattro-upstream. I'm happy to discuss here, on Discord or by mail (oliver@lukschander.com).
🤖 Generated with Claude Code