Wpa supplicant: Difference between revisions
imported>IgorM m Fixed syntax highlighting |
option has changed from environmentFile to secretsFile |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:wpa_supplicant}} | {{DISPLAYTITLE:wpa_supplicant}} | ||
[https://w1.fi/wpa_supplicant/ wpa_supplicant] is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WPA, WPA2 (IEEE 802.11i / RSN), and WPA3. It sets up connections to wireless networks. | |||
== General == | == General == | ||
Line 44: | Line 46: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
To avoid having your network password in accessible plaintext on your system or in your version control consider using [https://search.nixos.org/options?show=networking.wireless. | To avoid having your network password in accessible plaintext on your system or in your version control consider using [https://search.nixos.org/options?channel=25.05&show=networking.wireless.secretsFile&from=0&size=50&sort=relevance&type=packages&query=networking.wireless networking.wireless.secretsFile]. | ||
Another example of simple wpa2 auth: | |||
<syntaxhighlight lang="nix"> | |||
networking.networkmanager.enable = false; | |||
networking.wireless = { | |||
enable = true; # Enables wireless support via wpa_supplicant. | |||
networks."MYSSID".psk = "myPresharedKey"; | |||
extraConfig = "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel"; | |||
# output ends up in /run/wpa_supplicant/wpa_supplicant.conf | |||
}; | |||
</syntaxhighlight> | |||
== Switching Network == | == Switching Network == | ||
Line 112: | Line 126: | ||
}; | }; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
== WEP support == | |||
You may encounter a situation where you are in a hotel, for example, and the WiFi uses WEP encryption. As of version 2.10 of <code>wpa_supplicant</code>, WEP support is not enabled by default. To enable it, add the following to your <code>configuration.nix</code>: | |||
<syntaxHighlight lang=nixos> | |||
nixpkgs.overlays = [ | |||
(self: super: { | |||
wpa_supplicant = super.wpa_supplicant.overrideAttrs (oldAttrs: rec { | |||
extraConfig = oldAttrs.extraConfig + '' | |||
CONFIG_WEP=y | |||
''; | |||
}); | |||
}) | |||
]; | |||
</syntaxHighlight> | |||
This builds <code>wpa_supplicant</code> with WEP support. | |||
== Fixing "legacy sigalg disallowed or unsupported" == | == Fixing "legacy sigalg disallowed or unsupported" == | ||
Line 130: | Line 161: | ||
== External links == | == External links == | ||
[https://www.stura.htw-dresden.de/stura/ref/hopo/dk/nachrichten/eduroam-meets-nixos (german) article ''eduroam meets NixOS'' (with configuration)] (instance ''University of Applied Sciences Dresden'': The [https://cat.eduroam.org/?idp=5106&profile=5098 eduroam installer for GNU/Linux] works [https://www.htw-dresden.de/en/university/organisation/ | * [https://www.stura.htw-dresden.de/stura/ref/hopo/dk/nachrichten/eduroam-meets-nixos (german) article ''eduroam meets NixOS'' (with configuration)] (instance ''University of Applied Sciences Dresden'': The [https://cat.eduroam.org/?idp=5106&profile=5098 eduroam installer for GNU/Linux] works [https://www.htw-dresden.de/en/university/organisation/zid/service-overview-and-instructions/wi-fi-/-wlan/eduroam/linux for example for Ubuntu] but not [[NixOS]]) | ||
* [https://github.com/NixOS/nixpkgs/issues/177501 NixOs: Can't connect to a WEP network: failure to add network: invalid message format] | |||
[[Category:Software]] | |||
[[Category:Networking]] |