Skip to content

Commit

Permalink
nixos/networkmanager: fix merging options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jtojnar committed Nov 6, 2019
1 parent 7827d3f commit 894fdfa
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions nixos/modules/services/networking/networkmanager.nix
Expand Up @@ -456,15 +456,19 @@ in {
};

# Turn off NixOS' network management when networking is managed entirely by NetworkManager
networking = (mkIf (!delegateWireless) {
useDHCP = false;
# Use mkDefault to trigger the assertion about the conflict above
wireless.enable = mkDefault false;
}) // (mkIf cfg.enableStrongSwan {
networkmanager.packages = [ pkgs.networkmanager_strongswan ];
}) // (mkIf enableIwd {
wireless.iwd.enable = true;
});
networking = mkMerge [
(mkIf (!delegateWireless) {
useDHCP = false;
})

(mkIf cfg.enableStrongSwan {
networkmanager.packages = [ pkgs.networkmanager_strongswan ];
})

(mkIf enableIwd {
wireless.iwd.enable = true;
})
];

security.polkit.extraConfig = polkitConf;

Expand Down

0 comments on commit 894fdfa

Please sign in to comment.