nginx module: improve documentation

+31 -7
+12 -3
nixos/modules/services/web-servers/nginx/default.nix
··· 235 235 sslDhparam = mkOption { 236 236 type = types.nullOr types.path; 237 237 default = null; 238 - example = literalExample "/path/to/dhparams.pem"; 238 + example = "/path/to/dhparams.pem"; 239 239 description = "Path to DH parameters file."; 240 240 }; 241 241 ··· 246 246 default = { 247 247 localhost = {}; 248 248 }; 249 - example = []; 250 - description = '' 249 + example = literalExample '' 250 + { 251 + "hydra.example.com" = { 252 + forceSSL = true; 253 + enableACME = true; 254 + locations."/" = { 255 + proxyPass = "http://localhost:3000"; 256 + }; 257 + }; 258 + }; 251 259 ''; 260 + description = "Declarative vhost config"; 252 261 }; 253 262 }; 254 263 };
+19 -4
nixos/modules/services/web-servers/nginx/vhost-options.nix
··· 21 21 type = types.nullOr types.int; 22 22 default = null; 23 23 description = '' 24 - Port for the server. 80 for http 24 + Port for the server. Defaults to 80 for http 25 25 and 443 for https (i.e. when enableSSL is set). 26 26 ''; 27 27 }; ··· 109 109 basicAuth = mkOption { 110 110 type = types.attrsOf types.str; 111 111 default = {}; 112 - description = "user = password"; 112 + example = literalExample '' 113 + { 114 + user = "password"; 115 + }; 116 + ''; 117 + description = '' 118 + Basic Auth protection for a vhost. 119 + 120 + WARNING: This is implemented to store the password in plain text in the 121 + nix store. 122 + ''; 113 123 }; 114 124 115 125 locations = mkOption { ··· 117 127 inherit lib; 118 128 })); 119 129 default = {}; 120 - example = {}; 121 - description = '' 130 + example = literalExample '' 131 + { 132 + "/" = { 133 + proxyPass = "http://localhost:3000"; 134 + }; 135 + }; 122 136 ''; 137 + description = "Declarative location config"; 123 138 }; 124 139 }; 125 140 }