2014-08-24 19:18:18 +02: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 01:57:09 +02:00
|
|
|
<title>Wireless Networks</title>
|
2014-08-24 19:18:18 +02:00
|
|
|
|
2018-05-02 01:57:09 +02: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 19:18:18 +02:00
|
|
|
|
2018-05-02 01:57:09 +02:00
|
|
|
<para>
|
|
|
|
NixOS will start wpa_supplicant for you if you enable this setting:
|
2014-08-24 19:18:18 +02:00
|
|
|
<programlisting>
|
2018-04-05 10:43:56 +02:00
|
|
|
<xref linkend="opt-networking.wireless.enable"/> = true;
|
2014-08-24 19:18:18 +02:00
|
|
|
</programlisting>
|
2018-05-02 01:57:09 +02:00
|
|
|
NixOS lets you specify networks for wpa_supplicant declaratively:
|
2015-12-29 11:21:38 +01:00
|
|
|
<programlisting>
|
2018-04-05 10:43:56 +02:00
|
|
|
<xref linkend="opt-networking.wireless.networks"/> = {
|
2019-08-15 00:29:13 +02:00
|
|
|
echelon = { # SSID with no spaces or special characters
|
2015-12-29 11:21:38 +01:00
|
|
|
psk = "abcdefgh";
|
|
|
|
};
|
2019-08-15 00:29:13 +02:00
|
|
|
"echelon's AP" = { # SSID with spaces and/or special characters
|
|
|
|
psk = "ijklmnop";
|
|
|
|
};
|
|
|
|
echelon = { # Hidden SSID
|
|
|
|
hidden = true;
|
|
|
|
psk = "qrstuvwx";
|
|
|
|
};
|
|
|
|
free.wifi = {}; # Public wireless network
|
2019-03-21 23:22:13 +01:00
|
|
|
};
|
2015-12-29 11:21:38 +01:00
|
|
|
</programlisting>
|
2018-05-02 01:57:09 +02: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
|
2019-03-22 14:44:11 +01:00
|
|
|
yourself to define wireless networks, WPA keys and so on (see <citerefentry>
|
|
|
|
<refentrytitle>wpa_supplicant.conf</refentrytitle>
|
|
|
|
<manvolnum>5</manvolnum> </citerefentry>).
|
2018-05-02 01:57:09 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2019-03-05 03:27:15 +01:00
|
|
|
If you are using WPA2 you can generate pskRaw key using
|
|
|
|
<command>wpa_passphrase</command>:
|
|
|
|
<screen>
|
2019-06-17 13:25:50 +02:00
|
|
|
<prompt>$ </prompt>wpa_passphrase ESSID PSK
|
2019-03-05 03:27:15 +01:00
|
|
|
network={
|
|
|
|
ssid="echelon"
|
|
|
|
#psk="abcdefgh"
|
|
|
|
psk=dca6d6ed41f4ab5a984c9f55f6f66d4efdc720ebf66959810f4329bb391c5435
|
|
|
|
}
|
|
|
|
</screen>
|
|
|
|
<programlisting>
|
|
|
|
<xref linkend="opt-networking.wireless.networks"/> = {
|
|
|
|
echelon = {
|
|
|
|
pskRaw = "dca6d6ed41f4ab5a984c9f55f6f66d4efdc720ebf66959810f4329bb391c5435";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
</programlisting>
|
|
|
|
or you can use it to directly generate the
|
|
|
|
<literal>wpa_supplicant.conf</literal>:
|
2014-08-24 19:18:18 +02:00
|
|
|
<screen>
|
2019-06-17 13:25:50 +02:00
|
|
|
<prompt># </prompt>wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen>
|
2018-05-02 01:57:09 +02:00
|
|
|
After you have edited the <literal>wpa_supplicant.conf</literal>, you need to
|
|
|
|
restart the wpa_supplicant service.
|
2014-08-24 19:18:18 +02:00
|
|
|
<screen>
|
2019-06-17 13:25:50 +02:00
|
|
|
<prompt># </prompt>systemctl restart wpa_supplicant.service</screen>
|
2018-05-02 01:57:09 +02:00
|
|
|
</para>
|
2014-08-24 19:18:18 +02:00
|
|
|
</section>
|