Leave Wi-Fi to NetworkManager when archinstall turned on iwd as well
shellcheck / shellcheck (push) Failing after 14s

archinstall's "Copy ISO network configuration", which a user who connected
with iwctl may pick, turns on iwd and systemd-networkd. CoreDesktop then
turns on NetworkManager too, and after a restart two services fight over
the Wi-Fi card. system/wifi.sh disables iwd and systemd-networkd, without
stopping them, when NetworkManager is enabled and isn't set to use iwd
itself. install.sh runs it, and a migration runs it on existing machines.
The README tells users to choose NetworkManager in archinstall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 13:46:32 -07:00
co-authored by Claude Opus 5.5
parent e958e20431
commit cf862ecab0
5 changed files with 115 additions and 0 deletions
+4
View File
@@ -28,6 +28,7 @@ These scripts are based on the initial work of [Typecraft](https://www.youtube.c
(Note: if you're on a laptop and/or don't have a wired internet connection, set up Wi-Fi first. See "A Note About Networking in Arch" below.)
4) You will go through the different options. Mostly choose the defaults.
- At "Network configuration", choose "Use NetworkManager", even if you connected with `iwctl`. CoreDesktop uses NetworkManager, and GNOME's Wi-Fi menu needs it. "Copy ISO network configuration" turns on iwd instead, which fights NetworkManager over the Wi-Fi card; CoreDesktop turns iwd off if it finds it (see "Notes about what is installed").
5) Video cards: IF YOU HAVE AN NVIDIA GPU, CHOOSE THE PROPRIETARY NVIDIA OPTION. Choose the AMD option for AMD cards. Just works better. We've found Arch is very good at maintaining compatibility with Nvidia and AMD options.
6) When asked what type of system you want, the correct choice is "desktop" and the correct desktop environment is "Gnome".
7) For sound, "pipewire" is strongly recommended for the sound system choice during install. This is known to work really well with Jitsi, Element, and the other Federated Core SaaS applications, if you're using those. This may no longer be required in the newest installations of Arch Linux.
@@ -47,6 +48,8 @@ To list the wireless adapters type: `device list`. If your wireless device is "w
When you have the wireless network working (check by doing "ping google.com"), then you can proceed to install Arch.
This connection is only for the installer: `iwctl` saves your Wi-Fi password on the USB stick, not on your new system. Choose "Use NetworkManager" at archinstall's network step, and after the first boot choose your Wi-Fi network in GNOME's top-right menu.
## Installing Federated CoreDesktop
When Arch and Gnome have been successfully installed, you log in to the system then...
@@ -177,6 +180,7 @@ Besides installing software, CoreDesktop changes these settings. They're listed
- **systemd**: a 10-second stop timeout (/etc/systemd/system.conf.d/ and /etc/systemd/user.conf.d/10-coredesktop-timeout.conf), systemd-oomd for apps (/etc/systemd/user/app.slice.d/10-coredesktop-oomd.conf), and NetworkManager-wait-online is masked.
- **/etc/security/pam_env.conf**: a PATH line, so SSH commands find ~/.local/bin and mise.
- **mDNS**: Avahi is on, nss-mdns is added to /etc/nsswitch.conf, and SSH is advertised in /etc/avahi/services/ssh.service.
- **Wi-Fi**: if iwd is turned on alongside NetworkManager (archinstall's "Copy ISO network configuration" does that), iwd and systemd-networkd are turned off, so that NetworkManager runs the network from the next restart. Choose your Wi-Fi network once in GNOME's top-right menu after that restart. If you set NetworkManager to use iwd itself (`wifi.backend=iwd`), this leaves iwd alone.
- **Services turned on**: Avahi, Bluetooth, CUPS (printing), fwupd, GDM, NetworkManager, reflector (weekly), sshd, Docker, Tailscale, ufw and systemd-oomd. Your user is added to the docker group.
- **Snapper** (btrfs only): a config for / in /etc/snapper/configs/root.
- **NVIDIA** (only if it installs the driver): /etc/mkinitcpio.conf.d/nvidia.conf and NVIDIA's suspend services.
+4
View File
@@ -211,6 +211,10 @@ fi
echo "Applying system defaults..."
bash ~/.local/share/coredesktop/system/defaults.sh
# Leave Wi-Fi to NetworkManager alone if archinstall turned on iwd as well
echo "Checking Wi-Fi..."
bash ~/.local/share/coredesktop/system/wifi.sh
# SSH logins with keys only, not passwords
echo "Configuring the SSH server..."
bash ~/.local/share/coredesktop/system/sshd.sh
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Machines set up with iwctl and archinstall's "copy ISO network configuration"
# can have iwd and systemd-networkd running alongside NetworkManager, fighting
# over the Wi-Fi card. Leave Wi-Fi to NetworkManager alone.
bash "$HOME/.local/share/coredesktop/system/wifi.sh"
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
#
# Purpose : Leave Wi-Fi to NetworkManager alone. archinstall's "copy ISO network
# configuration" turns on iwd and systemd-networkd, so a machine set
# up with iwctl from the Arch ISO can have them running alongside
# NetworkManager, which CoreDesktop turns on. Then two services fight
# over the Wi-Fi card: connections drop, or Wi-Fi is missing from
# GNOME.
#
# This disables iwd and systemd-networkd without stopping them, so the network
# stays up until the next boot; after it, NetworkManager runs Wi-Fi and wired
# connections. iwd's saved Wi-Fi passwords don't carry over: choose the network
# once in GNOME's top-right menu.
#
# Changes nothing when NetworkManager isn't enabled, or when it is set up to
# use iwd itself (wifi.backend=iwd in /etc/NetworkManager/conf.d/).
systemctl is-enabled -q NetworkManager.service 2> /dev/null || exit 0
systemctl is-enabled -q iwd.service 2> /dev/null || exit 0
# Unset settings print commented out, so this matches only one someone set
if NetworkManager --print-config 2> /dev/null \
| grep -qE '^[[:space:]]*wifi\.backend[[:space:]]*=[[:space:]]*iwd[[:space:]]*$'; then
exit 0
fi
echo "Turning off iwd, so that NetworkManager runs Wi-Fi from the next restart..."
sudo systemctl disable iwd.service || exit 1
# archinstall turns systemd-networkd on with iwd. Its wait-online would hold up
# boot with nothing for it to wait for.
if systemctl is-enabled -q systemd-networkd.service 2> /dev/null; then
echo "Turning off systemd-networkd, so that NetworkManager runs the network..."
sudo systemctl disable systemd-networkd.service systemd-networkd.socket \
systemd-networkd-wait-online.service || exit 1
fi
echo "After you restart, choose your Wi-Fi network in GNOME's top-right menu"
echo "and enter its password once. The network stays up until then."
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bats
load test_helper
# system/wifi.sh with fake systemctl, sudo and NetworkManager. $ENABLED lists
# the enabled units; $NM_CONFIG is what NetworkManager --print-config prints.
setup() {
common_setup
export ENABLED="NetworkManager.service iwd.service systemd-networkd.service"
export NM_CONFIG=$'[device]\n# wifi.backend=wpa_supplicant'
stub systemctl '[ "$1" = is-enabled ] || exit 0
[[ " $ENABLED " == *" ${!#} "* ]]'
stub sudo '"$@"'
stub NetworkManager 'echo "$NM_CONFIG"'
}
@test "wifi.sh turns off iwd and systemd-networkd alongside NetworkManager" {
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 0 ]
called systemctl disable iwd.service
called systemctl disable systemd-networkd.service systemd-networkd.socket systemd-networkd-wait-online.service
[[ "$output" == *"GNOME's top-right menu"* ]]
}
@test "wifi.sh leaves systemd-networkd alone when it's off" {
ENABLED="NetworkManager.service iwd.service"
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 0 ]
called systemctl disable iwd.service
uncalled systemctl disable systemd-networkd.service systemd-networkd.socket systemd-networkd-wait-online.service
}
@test "wifi.sh does nothing without iwd" {
ENABLED="NetworkManager.service systemd-networkd.service"
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 0 ]
[ -z "$output" ]
not_called sudo
}
@test "wifi.sh does nothing when NetworkManager is off" {
ENABLED="iwd.service systemd-networkd.service"
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 0 ]
[ -z "$output" ]
not_called sudo
}
@test "wifi.sh leaves iwd to NetworkManager set up to use it" {
NM_CONFIG=$'[device]\nwifi.backend=iwd'
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 0 ]
[ -z "$output" ]
not_called sudo
}
@test "wifi.sh fails when it can't turn iwd off" {
stub sudo 'exit 1'
run bash "$REPO/system/wifi.sh"
[ "$status" -eq 1 ]
}