-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/networkmanager: allow iwd as Wi-Fi backend #68147
Conversation
Should this target staging, maybe? |
Don't think so. It shouldn't cause a mass rebuild since the feature is already enabled, changes don't touch the networkmanager expression. |
c8b9b8a
to
b676ca0
Compare
b676ca0
to
160d735
Compare
160d735
to
c12b181
Compare
So i tried using this and it appears there is some config that should be shared between the iwd module. diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index 0dc4aec95ab..1d4c1dd585e 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -526,5 +526,11 @@ in {
optional cfg.enableStrongSwan pkgs.strongswanNM ++ cfg.packages;
services.udev.packages = cfg.packages;
+
+ systemd.services.iwd.wantedBy = mkIf (cfg.wifi.backend == "iwd") [ "multi-user.target" ];
+
+ systemd.tmpfiles.rules = mkIf (cfg.wifi.backend == "iwd") [
+ "d /var/lib/iwd 0700 root root -"
+ ];
};
}
with that it worked on my system. I have to ask if they're really mutually exclusive? |
You should also include #68213 for networkmanager. |
Hm, I thought the assert that's in this change was specifically because NM controls the IWD lifecycle when IWD is used with NM. I may have had the Do you want me to pull the commit from #68213 in here, or just review it and make this PR depend on merging it first? |
Yeah, I think because of that the state directories would already have been ready.
I'm not sure if we're going the route of enabling the |
We discussed in depth on irc |
7a97ee0
to
ead2182
Compare
@worldofpeace It seems like chain-enabling the Can you take a look? I think I've addressed everything you mentioned now? |
ead2182
to
b07d6f5
Compare
@colemickens, new change got merged that added another variable to check into the mix. |
I had to do some weird merging fixups when I cherrypicked the ell/iwd-bump and then these two commits, but it seems to work fine. Should I squash and repush these, @worldofpeace ? |
Sure, I'll also request the review of one more person 👍 |
It would have been no-op until b4044a3 landed. We could revert it on master to fix the issue, as the assertion for that was broken. And then we can revert my fixup commit and merge. |
I'll check it out until tomorrow how to reconcile this with b4044a3. |
I'm not sure why
works for you, @worldofpeace. 🤔 With the new changes here, though, I'd add this diff to the PR: --- i/nixos/modules/services/networking/networkmanager.nix
+++ w/nixos/modules/services/networking/networkmanager.nix
@@ -394,10 +394,12 @@ in {
config = mkIf cfg.enable {
assertions = [
- { assertion = config.networking.wireless.enable == true -> cfg.unmanaged != [];
+ { assertion = config.networking.wireless.enable ->
+ (cfg.unmanaged != [] || cfg.wifi.backend == null);
message = ''
You can not use networking.networkmanager with networking.wireless.
- Except if you mark some interfaces as <literal>unmanaged</literal> by NetworkManager.
+ Except if you mark some interfaces as `unmanaged` by NetworkManager
+ or set the wifi backend to `null`.
'';
}
{ assertion = !dynamicHostsEnabled || (dynamicHostsEnabled && cfg.dns == "dnsmasq"); |
Huh, I tested again on a running system and I get the assertion message. I guess you can't test this with a vm. Also, I'm not sure if networkmanager has a concept of not using any backend. So allowing null as a value doesn't make sense. What actually matters is what's set as unmanaged. |
8eab2c9
to
deaf82f
Compare
iwd
as Wi-Fi backend
@JohnAZoidberg I believe this should be correct now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right. NM seems to use supplicant if no wifi.backend
is given.
This works for me. But
So I guess |
Interesting,
We currently default to |
Actually, I think |
Indeed with internal |
OT: what's the advantage of using iwd as a NM backend as opposed to just using |
Not familiar with these, so I might speak nonsense, but AFAIU, NetworkManager has everything in one place. So you can manage wired&wireless connections and VPN from one app/applet/trayicon. |
This introduces an option wifi.backend to the networkmanager module. Co-authored-by: Cole Mickens <cole.mickens@gmail.com> Co-authored-by: worldofpeace <worldofpeace@protonmail.ch>
deaf82f
to
86dea55
Compare
Rebased as I've removed the |
Replaces #51803. Please see it for earlier discussion. I think all I did was rebase and fix merge conflicts. As requested by @dtzWill.
Works well for me. Connecting and disconnecting via
nmtui
is remarkably faster than with wpa_supplicant (or, at least, without this change and using IWD).