Merge pull request #8630 from lihop/nixos/fix-formatting

nixos: fix formatting of option examples

+107 -96
+10 -10
nixos/modules/config/vpnc.nix
··· 17 17 services = mkOption { 18 18 type = types.attrsOf types.str; 19 19 default = {}; 20 - example = { 21 - test = 22 - '' 23 - IPSec gateway 192.168.1.1 24 - IPSec ID someID 25 - IPSec secret secretKey 26 - Xauth username name 27 - Xauth password pass 28 - ''; 29 - }; 20 + example = literalExample '' 21 + { test = ''' 22 + IPSec gateway 192.168.1.1 23 + IPSec ID someID 24 + IPSec secret secretKey 25 + Xauth username name 26 + Xauth password pass 27 + '''; 28 + } 29 + ''; 30 30 description = 31 31 '' 32 32 The names of cisco VPNs and their associated definitions
+8 -8
nixos/modules/programs/freetds.nix
··· 17 17 environment.freetds = mkOption { 18 18 type = types.attrsOf types.str; 19 19 default = {}; 20 - example = { 21 - MYDATABASE = 22 - '' 23 - host = 10.0.2.100 24 - port = 1433 25 - tds version = 7.2 26 - ''; 27 - }; 20 + example = literalExample '' 21 + { MYDATABASE = ''' 22 + host = 10.0.2.100 23 + port = 1433 24 + tds version = 7.2 25 + '''; 26 + } 27 + ''; 28 28 description = 29 29 '' 30 30 Configure freetds database entries. Each attribute denotes
+11 -8
nixos/modules/security/ca.nix
··· 35 35 security.pki.certificates = mkOption { 36 36 type = types.listOf types.str; 37 37 default = []; 38 - example = singleton '' 39 - NixOS.org 40 - ========= 41 - -----BEGIN CERTIFICATE----- 42 - MIIGUDCCBTigAwIBAgIDD8KWMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ 43 - TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0 44 - ... 45 - -----END CERTIFICATE----- 38 + example = literalExample '' 39 + [ ''' 40 + NixOS.org 41 + ========= 42 + -----BEGIN CERTIFICATE----- 43 + MIIGUDCCBTigAwIBAgIDD8KWMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ 44 + TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0 45 + ... 46 + -----END CERTIFICATE----- 47 + ''' 48 + ] 46 49 ''; 47 50 description = '' 48 51 A list of trusted root certificates in PEM format.
+28 -25
nixos/modules/services/networking/nsd.nix
··· 621 621 zones = mkOption { 622 622 type = types.attrsOf zoneOptions; 623 623 default = {}; 624 - example = { 625 - "serverGroup1" = { 626 - provideXFR = [ "10.1.2.3 NOKEY" ]; 627 - children = { 628 - "example.com." = { 629 - data = '' 630 - $ORIGIN example.com. 631 - $TTL 86400 632 - @ IN SOA a.ns.example.com. admin.example.com. ( 633 - ... 634 - ''; 635 - }; 636 - "example.org." = { 637 - data = '' 638 - $ORIGIN example.org. 639 - $TTL 86400 640 - @ IN SOA a.ns.example.com. admin.example.com. ( 641 - ... 642 - ''; 624 + example = literalExample '' 625 + { "serverGroup1" = { 626 + provideXFR = [ "10.1.2.3 NOKEY" ]; 627 + children = { 628 + "example.com." = { 629 + data = ''' 630 + $ORIGIN example.com. 631 + $TTL 86400 632 + @ IN SOA a.ns.example.com. admin.example.com. ( 633 + ... 634 + '''; 635 + }; 636 + "example.org." = { 637 + data = ''' 638 + $ORIGIN example.org. 639 + $TTL 86400 640 + @ IN SOA a.ns.example.com. admin.example.com. ( 641 + ... 642 + '''; 643 + }; 643 644 }; 644 645 }; 645 - }; 646 646 647 - "example.net." = { 648 - provideXFR = [ "10.3.2.1 NOKEY" ]; 649 - data = ''...''; 650 - }; 651 - }; 647 + "example.net." = { 648 + provideXFR = [ "10.3.2.1 NOKEY" ]; 649 + data = ''' 650 + ... 651 + '''; 652 + }; 653 + } 654 + ''; 652 655 description = '' 653 656 Define your zones here. Zones can cascade other zones and therefore 654 657 inherit settings from parent zones. Look at the definition of
+14 -14
nixos/modules/services/security/fail2ban.nix
··· 50 50 51 51 jails = mkOption { 52 52 default = { }; 53 - example = 54 - { "apache-nohome-iptables" = 55 - '' 56 - # Block an IP address if it accesses a non-existent 57 - # home directory more than 5 times in 10 minutes, 58 - # since that indicates that it's scanning. 59 - filter = apache-nohome 60 - action = iptables-multiport[name=HTTP, port="http,https"] 61 - logpath = /var/log/httpd/error_log* 62 - findtime = 600 63 - bantime = 600 64 - maxretry = 5 65 - ''; 66 - }; 53 + example = literalExample '' 54 + { apache-nohome-iptables = ''' 55 + # Block an IP address if it accesses a non-existent 56 + # home directory more than 5 times in 10 minutes, 57 + # since that indicates that it's scanning. 58 + filter = apache-nohome 59 + action = iptables-multiport[name=HTTP, port="http,https"] 60 + logpath = /var/log/httpd/error_log* 61 + findtime = 600 62 + bantime = 600 63 + maxretry = 5 64 + '''; 65 + } 66 + ''; 67 67 type = types.attrsOf types.lines; 68 68 description = 69 69 ''
+13 -12
nixos/modules/services/web-servers/phpfpm.nix
··· 53 53 poolConfigs = mkOption { 54 54 type = types.attrsOf types.lines; 55 55 default = {}; 56 - example = { 57 - mypool = '' 58 - listen = /run/phpfpm/mypool 59 - user = nobody 60 - pm = dynamic 61 - pm.max_children = 75 62 - pm.start_servers = 10 63 - pm.min_spare_servers = 5 64 - pm.max_spare_servers = 20 65 - pm.max_requests = 500 66 - ''; 67 - }; 56 + example = literalExample '' 57 + { mypool = ''' 58 + listen = /run/phpfpm/mypool 59 + user = nobody 60 + pm = dynamic 61 + pm.max_children = 75 62 + pm.start_servers = 10 63 + pm.min_spare_servers = 5 64 + pm.max_spare_servers = 20 65 + pm.max_requests = 500 66 + '''; 67 + } 68 + ''; 68 69 description = '' 69 70 A mapping between PHP FPM pool names and their configurations. 70 71 See the documentation on <literal>php-fpm.conf</literal> for
+10 -7
nixos/modules/services/x11/xserver.nix
··· 156 156 inputClassSections = mkOption { 157 157 type = types.listOf types.lines; 158 158 default = []; 159 - example = [ '' 160 - Identifier "Trackpoint Wheel Emulation" 161 - MatchProduct "ThinkPad USB Keyboard with TrackPoint" 162 - Option "EmulateWheel" "true 163 - Option "EmulateWheelButton" "2" 164 - Option "Emulate3Buttons" "false" 165 - '' ]; 159 + example = literalExample '' 160 + [ ''' 161 + Identifier "Trackpoint Wheel Emulation" 162 + MatchProduct "ThinkPad USB Keyboard with TrackPoint" 163 + Option "EmulateWheel" "true 164 + Option "EmulateWheelButton" "2" 165 + Option "Emulate3Buttons" "false" 166 + ''' 167 + ] 168 + ''; 166 169 description = "Content of additional InputClass sections of the X server configuration file."; 167 170 }; 168 171
+13 -12
nixos/modules/system/activation/activation-script.nix
··· 30 30 system.activationScripts = mkOption { 31 31 default = {}; 32 32 33 - example = { 34 - stdio = { 35 - text = '' 36 - # Needed by some programs. 37 - ln -sfn /proc/self/fd /dev/fd 38 - ln -sfn /proc/self/fd/0 /dev/stdin 39 - ln -sfn /proc/self/fd/1 /dev/stdout 40 - ln -sfn /proc/self/fd/2 /dev/stderr 41 - ''; 42 - deps = []; 43 - }; 44 - }; 33 + example = literalExample '' 34 + { stdio = { 35 + text = ''' 36 + # Needed by some programs. 37 + ln -sfn /proc/self/fd /dev/fd 38 + ln -sfn /proc/self/fd/0 /dev/stdin 39 + ln -sfn /proc/self/fd/1 /dev/stdout 40 + ln -sfn /proc/self/fd/2 /dev/stderr 41 + '''; 42 + deps = []; 43 + }; 44 + } 45 + ''; 45 46 46 47 description = '' 47 48 A set of shell script fragments that are executed when a NixOS