Wpa supplicant: Difference between revisions
imported>Sheepfleece No edit summary |
imported>ImExtends Example of configuring networks with the configuration file. |
||
Line 18: | Line 18: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
users.extraUsers.USER.extraGroups = [ "wheel" ]; | users.extraUsers.USER.extraGroups = [ "wheel" ]; | ||
</syntaxHighlight> | |||
== Using wpa_supplicant from within the configuration file == | |||
You can configure your networks with the option <code>networks</code>. You have to fill the name(s) of your wifi(s) after the option and the preshared-key(s) (usually called <code>psk</code>). If you do not want to have your secret key in plaintext, you can use pskRaw, generated with <code>wpa_passphrase SSID password</code>. An example of using networks : | |||
<syntaxHighlight lang=nix> | |||
networking.wireless.networks.Wifi_name.pskRaw = "pskRaw generated"; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
Revision as of 17:42, 20 July 2020
Can be enabled on NixOS with networking.wireless.enable = true
.
Extra configuration can be specified inside networking.wireless.extraConfig
.
Wpa_supplicant_gui
To be able to use wpa_gui
as user put the following in your configuration.nix
file:
networking.wireless.extraConfig = ''
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
'';
Also your user must be part of the wheel
group (replace USER with your username):
users.extraUsers.USER.extraGroups = [ "wheel" ];
Using wpa_supplicant from within the configuration file
You can configure your networks with the option networks
. You have to fill the name(s) of your wifi(s) after the option and the preshared-key(s) (usually called psk
). If you do not want to have your secret key in plaintext, you can use pskRaw, generated with wpa_passphrase SSID password
. An example of using networks :
networking.wireless.networks.Wifi_name.pskRaw = "pskRaw generated";
Switching Network
From the shell terminal, use the wpa_cli
command line tool and specify the network interface device with -g
wpa_cli -g /run/wpa_supplicant/wlp3s0
list_network
select_network 2
As a means to debug if things are working, open another terminal and examine the logs by:
journalctl -u wpa_supplicant -f