Skip to content
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

Allow NetworkManager and wireless together #64364

Merged
merged 1 commit into from Sep 13, 2019

Conversation

JohnAZoidberg
Copy link
Member

@JohnAZoidberg JohnAZoidberg commented Jul 6, 2019

Motivation for this change

When NetworkManager is configured to not manage all interfaces, it's
perfectly fine to have the rest be managed by the standard nixos
wireless scripts.

I use something like this:

  networking.networkmanager = {
    enable = true;

    # Manage only wireless modem interfaces
    unmanaged = [ "*" "except:type:wwan" "except:type:gsm" ];
  };

  # Enable wireless support via wpa_supplicant
  networking.wireless = {
    enable = true;

    networks = {
      "WIFIonICE" = {  # ICE Deutsche Bahn WiFi
        priority = 9;
      };
      // My private networks
    };
  };

to control everything using networking.wireless except for the mobile
LTE modem which only works with NetworkManager.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -173,13 +173,24 @@ in {
'';
};

withSupplicant = mkOption {
internal = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the internal here. Also we could use a more generic option like "ignoreWireless"/ "delegateWireless" without naming supplicant as there might be other options in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure about the semantics of internal.
Actually I think I want it to be just a variable.
Is internal like a config option that the user cannot set themself, just the module?
Yeah okay, not calling it supplicant makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to a variable with the name delegateWireless.

@JohnAZoidberg
Copy link
Member Author

JohnAZoidberg commented Jul 9, 2019

cc @jtojnar @Mic92 @vcunat because you've commmitted to both the network manager service and the modem-manager package. Maybe you also find it useful for the purpose of using the modem while using networking.wireless.enable.

When NetworkManager is configured to not manage all interfaces, it's
perfectly fine to have the rest be managed by the standard nixos
wireless scripts.

I use
  networking.networkmanager.unmanaged = [
    "*" "except:type:wwan" "except:type:gsm"
  ];
to control everything using networking.wireless except for the mobile
LTE modem which only works with NetworkManager.
@JohnAZoidberg
Copy link
Member Author

Rebased on top of master.
Any thoughts anyone? I've been using this successfully for months :)

@globin globin merged commit 7782ffb into NixOS:master Sep 13, 2019
@JohnAZoidberg JohnAZoidberg deleted the nm-wireless branch September 13, 2019 11:23
jtojnar added a commit to jtojnar/nixpkgs that referenced this pull request Nov 6, 2019
Incorrect merging of modules resulted in dhcpcd being enabled causing flaky network connection.

NixOS#64364

Fixing it uncovered an infinite recursion from the same commit, previously masked by the incorrect merge.

We can just drop the `mkDefault` for `networking.wireless.enable` as it is already `false` by default.

Closes: NixOS#72416
jtojnar added a commit to jtojnar/nixpkgs that referenced this pull request Nov 6, 2019
Incorrect merging of modules resulted in dhcpcd being enabled causing flaky network connection.

NixOS#64364

Fixing it uncovered an infinite recursion from the same commit, previously masked by the incorrect merge.

While this is not a problem in 19.09, we can still drop the `mkDefault` for `networking.wireless.enable` as it is already `false` by default.

Closes: NixOS#72416

(cherry picked from commit 894fdfa)
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Nov 7, 2019
Incorrect merging of modules resulted in dhcpcd being enabled causing flaky network connection.

NixOS#64364

Fixing it uncovered an infinite recursion from the same commit, previously masked by the incorrect merge.

We can just drop the `mkDefault` for `networking.wireless.enable` as it is already `false` by default.

Closes: NixOS#72416
(cherry picked from commit 894fdfa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants