Import iwd WiFi networks into NetworkManager on upgrade#6321
Open
RushiChaganti wants to merge 1 commit into
Open
Import iwd WiFi networks into NetworkManager on upgrade#6321RushiChaganti wants to merge 1 commit into
RushiChaganti wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an Omarchy migration to restore WiFi connectivity after upgrading to quattro by importing previously saved iwd networks from /var/lib/iwd into NetworkManager connection profiles, aiming to make upgrades feel seamless for users whose networks otherwise appear “forgotten”.
Changes:
- Add a new migration that scans iwd’s saved network store and recreates open/WPA-PSK networks as NetworkManager connections.
- Implement SSID decoding for iwd’s filename formats and skip SSIDs already known to NetworkManager (idempotent import).
- Respect hidden-network configuration when generating NetworkManager profiles; leave 802.1x/enterprise networks for manual re-add.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+15
| as_root() { | ||
| if (( EUID == 0 )); then | ||
| "$@" | ||
| else | ||
| sudo "$@" | ||
| fi | ||
| } |
Comment on lines
+71
to
+74
| as_root nmcli connection add type wifi con-name "$ssid" ssid "$ssid" \ | ||
| 802-11-wireless.hidden "$hidden" \ | ||
| wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$secret" \ | ||
| connection.autoconnect yes \ |
Comment on lines
+1
to
+7
| echo "Import WiFi networks from iwd into NetworkManager" | ||
|
|
||
| # The quattro upgrade retired iwd/systemd-networkd in favor of NetworkManager | ||
| # but did not carry over previously-saved WiFi networks, so they appear | ||
| # "forgotten". Their credentials still live in iwd's store; re-create them as | ||
| # NetworkManager profiles. Idempotent and best-effort: it never aborts the | ||
| # migration run and skips networks NetworkManager already knows. |
The quattro migration retired iwd/systemd-networkd in favor of NetworkManager but never carried over previously-saved WiFi networks, so they appear "forgotten" after upgrading. Add a migration that re-creates them as NetworkManager profiles from iwd's on-disk store (/var/lib/iwd). It is idempotent (skips SSIDs NetworkManager already knows), best-effort (never aborts the migration run), handles open/WPA-PSK and hidden networks, and leaves 802.1x enterprise networks for manual re-add. Profiles are written as keyfiles directly into NetworkManager's store rather than through `nmcli connection add`. A PSK passed to nmcli would sit in argv and be readable from /proc by any local user for the life of the call; here the profile travels over stdin into a root-owned 0600 file, and only `nmcli connection reload` is invoked. Covered by test/shell.d/iwd-wifi-import-test.sh, which stubs nmcli/systemctl/sudo against a temp iwd store and asserts the parsing, hex-SSID decoding, 802.1x skip, file mode, idempotency, and that no secret ever reaches nmcli's argv. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9uCtJinm6xw8QEe9WHzvo
RushiChaganti
force-pushed
the
fix/import-iwd-wifi-networks
branch
from
July 20, 2026 05:06
2b9a7aa to
3279677
Compare
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.
The quattro migration retired iwd/systemd-networkd in favor of NetworkManager but never carried over previously-saved WiFi networks, so they appear "forgotten" after upgrading.
Add a migration that re-creates them as NetworkManager profiles from iwd's on-disk store (/var/lib/iwd). It is idempotent (skips SSIDs NetworkManager already knows), best-effort (never aborts the migration run), handles open/WPA-PSK and hidden networks, and leaves 802.1x enterprise networks for manual re-add.