Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5edb20533d1b
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c76a1ea594e8
Choose a head ref
  • 2 commits
  • 1 file changed
  • 3 contributors

Commits on Oct 3, 2019

  1. nixos/networkmanager: allow iwd as Wi-Fi backend

    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>
    3 people committed Oct 3, 2019
    Copy the full SHA
    86dea55 View commit details
  2. Merge pull request #68147 from colemickens/nixpkgs-nm-iwd

    nixos/networkmanager: allow iwd as Wi-Fi backend
    worldofpeace authored Oct 3, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c76a1ea View commit details
Showing with 16 additions and 2 deletions.
  1. +16 −2 nixos/modules/services/networking/networkmanager.nix
18 changes: 16 additions & 2 deletions nixos/modules/services/networking/networkmanager.nix
Original file line number Diff line number Diff line change
@@ -15,13 +15,15 @@ let
networkmanager-openconnect
networkmanager-openvpn
networkmanager-vpnc
] ++ optional (!delegateWireless) wpa_supplicant;
] ++ optional (!delegateWireless && !enableIwd) wpa_supplicant;

dynamicHostsEnabled =
cfg.dynamicHosts.enable && cfg.dynamicHosts.hostsDirs != {};

delegateWireless = config.networking.wireless.enable == true && cfg.unmanaged != [];

enableIwd = cfg.wifi.backend == "iwd";

# /var/lib/misc is for dnsmasq.leases.
stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";

@@ -50,6 +52,7 @@ let
[device]
wifi.scan-rand-mac-address=${if cfg.wifi.scanRandMacAddress then "yes" else "no"}
wifi.backend=${cfg.wifi.backend}
${cfg.extraConfig}
'';
@@ -236,6 +239,15 @@ in {
wifi = {
macAddress = macAddressOpt;

backend = mkOption {
type = types.enum [ "wpa_supplicant" "iwd" ];
default = "wpa_supplicant";
description = ''
Specify the Wi-Fi backend used for the device.
Currently supported are <option>wpa_supplicant</option> or <option>iwd</option> (experimental).
'';
};

powersave = mkOption {
type = types.nullOr types.bool;
default = null;
@@ -390,7 +402,7 @@ in {
{ assertion = !dynamicHostsEnabled || (dynamicHostsEnabled && cfg.dns == "dnsmasq");
message = ''
To use networking.networkmanager.dynamicHosts you also need to set
networking.networkmanager.dns = "dnsmasq"
`networking.networkmanager.dns = "dnsmasq"`
'';
}
];
@@ -510,6 +522,8 @@ in {
wireless.enable = mkDefault false;
}) // (mkIf cfg.enableStrongSwan {
networkmanager.packages = [ pkgs.networkmanager_strongswan ];
}) // (mkIf enableIwd {
wireless.iwd.enable = true;
});

security.polkit.extraConfig = polkitConf;