about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-09-26 22:56:20 -0400
committerGitHub <noreply@github.com>2019-09-26 22:56:20 -0400
commit985697bff7035ff8f935efc585cd344033206b35 (patch)
treebd2bd13403f1d52e59a9609483ce2822b9fc63f8 /nixos
parentc9b85da380d4c15e3bec8b7d2124455e0fbae423 (diff)
parentcce7486deb2be3375c0a58899af5e5ff802bf869 (diff)
downloadnixlib-985697bff7035ff8f935efc585cd344033206b35.tar
nixlib-985697bff7035ff8f935efc585cd344033206b35.tar.gz
nixlib-985697bff7035ff8f935efc585cd344033206b35.tar.bz2
nixlib-985697bff7035ff8f935efc585cd344033206b35.tar.lz
nixlib-985697bff7035ff8f935efc585cd344033206b35.tar.xz
nixlib-985697bff7035ff8f935efc585cd344033206b35.tar.zst
nixlib-985697bff7035ff8f935efc585cd344033206b35.zip
Merge pull request #66652 from craigem/clarify_wireless_examples
nixos/doc: Clarify wireless examples 
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/configuration/wireless.xml11
-rw-r--r--nixos/modules/services/networking/wpa_supplicant.nix14
2 files changed, 21 insertions, 4 deletions
diff --git a/nixos/doc/manual/configuration/wireless.xml b/nixos/doc/manual/configuration/wireless.xml
index 9c0e3a8d7aa4..247d29d58314 100644
--- a/nixos/doc/manual/configuration/wireless.xml
+++ b/nixos/doc/manual/configuration/wireless.xml
@@ -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
diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix
index 63e59e7c8fac..294c0d70edea 100644
--- a/nixos/modules/services/networking/wpa_supplicant.nix
+++ b/nixos/modules/services/networking/wpa_supplicant.nix
@@ -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 {
@@ -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
           }
         '';
       };