Skip to content

Commit

Permalink
nixos/doc: Clarify wireless examples
Browse files Browse the repository at this point in the history
This commits makes it clearer to a novice reader how to configure several
diferent types of SSID connections that were otherwise obscurely documented

Resolves NixOS#66650
  • Loading branch information
craigem authored and worldofpeace committed Sep 27, 2019
1 parent bc00723 commit cce7486
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 9 additions & 2 deletions nixos/doc/manual/configuration/wireless.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
NixOS lets you specify networks for wpa_supplicant declaratively:
<programlisting>
<xref linkend="opt-networking.wireless.networks"/> = {
echelon = {
echelon = { # SSID with no spaces or special characters
psk = "abcdefgh";
};
"free.wifi" = {};
"echelon's AP" = { # SSID with spaces and/or special characters
psk = "ijklmnop";
};
echelon = { # Hidden SSID
hidden = true;
psk = "qrstuvwx";
};
free.wifi = {}; # Public wireless network
};
</programlisting>
Be aware that keys will be written to the nix store in plaintext! When no
Expand Down
14 changes: 12 additions & 2 deletions nixos/modules/services/networking/wpa_supplicant.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ in {
description = ''
Set this to <literal>true</literal> if the SSID of the network is hidden.
'';
example = literalExample ''
{ echelon = {
hidden = true;
psk = "abcdefgh";
};
}
'';
};

priority = mkOption {
Expand Down Expand Up @@ -146,10 +153,13 @@ in {
'';
default = {};
example = literalExample ''
{ echelon = {
{ echelon = { # SSID with no spaces or special characters
psk = "abcdefgh";
};
"free.wifi" = {};
"echelon's AP" = { # SSID with spaces and/or special characters
psk = "ijklmnop";
};
"free.wifi" = {}; # Public wireless network
}
'';
};
Expand Down

0 comments on commit cce7486

Please sign in to comment.