Is it possible to configure WiFi connection in NetworkManager?

Hi folks,

Could you please help me with Network Manager?

Is there a NixOS configuration option to add Wi-Fi or other connection to Network Manager?

If not then that’s OK since I should be able to solve it by:

config.environment.etc."etc/NetworkManager/system-connections/mywifi.nmconnection" = { Text = "...";  }

But just want to ask first before trying to create a file like this.

Of course I searched options networking.networkmanager on on and networkmanager on but I didn’t find anything that can do that.

Thank you.

1 Like

The network configuration settings specified in the configuration.nix file should, under normal circumstances, function properly without requiring additional modifications.

  networking = {
    hostName = "nixos";
    networkmanager.enable = true;

I don’t think that’s what @geor is asking, they’re asking if there’s a way to declaratively configure individual wifi configurations. I have the same need for my school wifi, and I also wasn’t able to find a specific module for this kind of file, and had to use the environment.etc.<name>.text option as offered as an alternative.

Take a look at Imperative & Declarative Wifi networks with wpa_supplicant - #6 by hpoussin , where I created a module to generate nmconnection files.