2014-08-24 18:18:18 +01:00
|
|
|
<section xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
version="5.0"
|
|
|
|
xml:id="sec-wireless">
|
2018-05-02 00:57:09 +01:00
|
|
|
<title>Wireless Networks</title>
|
2014-08-24 18:18:18 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
For a desktop installation using NetworkManager (e.g., GNOME), you just have
|
|
|
|
to make sure the user is in the <code>networkmanager</code> group and you can
|
|
|
|
skip the rest of this section on wireless networks.
|
|
|
|
</para>
|
2014-08-24 18:18:18 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
NixOS will start wpa_supplicant for you if you enable this setting:
|
2014-08-24 18:18:18 +01:00
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
<xref linkend="opt-networking.wireless.enable"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
NixOS lets you specify networks for wpa_supplicant declaratively:
|
2015-12-29 10:21:38 +00:00
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
<xref linkend="opt-networking.wireless.networks"/> = {
|
2015-12-29 10:21:38 +00:00
|
|
|
echelon = {
|
|
|
|
psk = "abcdefgh";
|
|
|
|
};
|
|
|
|
"free.wifi" = {};
|
|
|
|
}
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
Be aware that keys will be written to the nix store in plaintext! When no
|
|
|
|
networks are set, it will default to using a configuration file at
|
|
|
|
<literal>/etc/wpa_supplicant.conf</literal>. You should edit this file
|
|
|
|
yourself to define wireless networks, WPA keys and so on (see
|
|
|
|
wpa_supplicant.conf(5)).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you are using WPA2 the <command>wpa_passphrase</command> tool might be
|
|
|
|
useful to generate the <literal>wpa_supplicant.conf</literal>.
|
2014-08-24 18:18:18 +01:00
|
|
|
<screen>
|
2016-06-01 15:23:32 +01:00
|
|
|
# wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
After you have edited the <literal>wpa_supplicant.conf</literal>, you need to
|
|
|
|
restart the wpa_supplicant service.
|
2014-08-24 18:18:18 +01:00
|
|
|
<screen>
|
2016-06-01 15:23:32 +01:00
|
|
|
# systemctl restart wpa_supplicant.service</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
</para>
|
2014-08-24 18:18:18 +01:00
|
|
|
</section>
|