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

nixos: fix formatting of option examples

Changed files
+107 -96
nixos
modules
config
programs
security
services
networking
security
web-servers
x11
system
+10 -10
nixos/modules/config/vpnc.nix
···
services = mkOption {
type = types.attrsOf types.str;
default = {};
-
example = {
-
test =
-
''
-
IPSec gateway 192.168.1.1
-
IPSec ID someID
-
IPSec secret secretKey
-
Xauth username name
-
Xauth password pass
-
'';
-
};
+
example = literalExample ''
+
{ test = '''
+
IPSec gateway 192.168.1.1
+
IPSec ID someID
+
IPSec secret secretKey
+
Xauth username name
+
Xauth password pass
+
''';
+
}
+
'';
description =
''
The names of cisco VPNs and their associated definitions
+8 -8
nixos/modules/programs/freetds.nix
···
environment.freetds = mkOption {
type = types.attrsOf types.str;
default = {};
-
example = {
-
MYDATABASE =
-
''
-
host = 10.0.2.100
-
port = 1433
-
tds version = 7.2
-
'';
-
};
+
example = literalExample ''
+
{ MYDATABASE = '''
+
host = 10.0.2.100
+
port = 1433
+
tds version = 7.2
+
''';
+
}
+
'';
description =
''
Configure freetds database entries. Each attribute denotes
+11 -8
nixos/modules/security/ca.nix
···
security.pki.certificates = mkOption {
type = types.listOf types.str;
default = [];
-
example = singleton ''
-
NixOS.org
-
=========
-
-----BEGIN CERTIFICATE-----
-
MIIGUDCCBTigAwIBAgIDD8KWMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ
-
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
-
...
-
-----END CERTIFICATE-----
+
example = literalExample ''
+
[ '''
+
NixOS.org
+
=========
+
-----BEGIN CERTIFICATE-----
+
MIIGUDCCBTigAwIBAgIDD8KWMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ
+
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
+
...
+
-----END CERTIFICATE-----
+
'''
+
]
'';
description = ''
A list of trusted root certificates in PEM format.
+28 -25
nixos/modules/services/networking/nsd.nix
···
zones = mkOption {
type = types.attrsOf zoneOptions;
default = {};
-
example = {
-
"serverGroup1" = {
-
provideXFR = [ "10.1.2.3 NOKEY" ];
-
children = {
-
"example.com." = {
-
data = ''
-
$ORIGIN example.com.
-
$TTL 86400
-
@ IN SOA a.ns.example.com. admin.example.com. (
-
...
-
'';
-
};
-
"example.org." = {
-
data = ''
-
$ORIGIN example.org.
-
$TTL 86400
-
@ IN SOA a.ns.example.com. admin.example.com. (
-
...
-
'';
+
example = literalExample ''
+
{ "serverGroup1" = {
+
provideXFR = [ "10.1.2.3 NOKEY" ];
+
children = {
+
"example.com." = {
+
data = '''
+
$ORIGIN example.com.
+
$TTL 86400
+
@ IN SOA a.ns.example.com. admin.example.com. (
+
...
+
''';
+
};
+
"example.org." = {
+
data = '''
+
$ORIGIN example.org.
+
$TTL 86400
+
@ IN SOA a.ns.example.com. admin.example.com. (
+
...
+
''';
+
};
};
};
-
};
-
"example.net." = {
-
provideXFR = [ "10.3.2.1 NOKEY" ];
-
data = ''...'';
-
};
-
};
+
"example.net." = {
+
provideXFR = [ "10.3.2.1 NOKEY" ];
+
data = '''
+
...
+
''';
+
};
+
}
+
'';
description = ''
Define your zones here. Zones can cascade other zones and therefore
inherit settings from parent zones. Look at the definition of
+14 -14
nixos/modules/services/security/fail2ban.nix
···
jails = mkOption {
default = { };
-
example =
-
{ "apache-nohome-iptables" =
-
''
-
# Block an IP address if it accesses a non-existent
-
# home directory more than 5 times in 10 minutes,
-
# since that indicates that it's scanning.
-
filter = apache-nohome
-
action = iptables-multiport[name=HTTP, port="http,https"]
-
logpath = /var/log/httpd/error_log*
-
findtime = 600
-
bantime = 600
-
maxretry = 5
-
'';
-
};
+
example = literalExample ''
+
{ apache-nohome-iptables = '''
+
# Block an IP address if it accesses a non-existent
+
# home directory more than 5 times in 10 minutes,
+
# since that indicates that it's scanning.
+
filter = apache-nohome
+
action = iptables-multiport[name=HTTP, port="http,https"]
+
logpath = /var/log/httpd/error_log*
+
findtime = 600
+
bantime = 600
+
maxretry = 5
+
''';
+
}
+
'';
type = types.attrsOf types.lines;
description =
''
+13 -12
nixos/modules/services/web-servers/phpfpm.nix
···
poolConfigs = mkOption {
type = types.attrsOf types.lines;
default = {};
-
example = {
-
mypool = ''
-
listen = /run/phpfpm/mypool
-
user = nobody
-
pm = dynamic
-
pm.max_children = 75
-
pm.start_servers = 10
-
pm.min_spare_servers = 5
-
pm.max_spare_servers = 20
-
pm.max_requests = 500
-
'';
-
};
+
example = literalExample ''
+
{ mypool = '''
+
listen = /run/phpfpm/mypool
+
user = nobody
+
pm = dynamic
+
pm.max_children = 75
+
pm.start_servers = 10
+
pm.min_spare_servers = 5
+
pm.max_spare_servers = 20
+
pm.max_requests = 500
+
''';
+
}
+
'';
description = ''
A mapping between PHP FPM pool names and their configurations.
See the documentation on <literal>php-fpm.conf</literal> for
+10 -7
nixos/modules/services/x11/xserver.nix
···
inputClassSections = mkOption {
type = types.listOf types.lines;
default = [];
-
example = [ ''
-
Identifier "Trackpoint Wheel Emulation"
-
MatchProduct "ThinkPad USB Keyboard with TrackPoint"
-
Option "EmulateWheel" "true
-
Option "EmulateWheelButton" "2"
-
Option "Emulate3Buttons" "false"
-
'' ];
+
example = literalExample ''
+
[ '''
+
Identifier "Trackpoint Wheel Emulation"
+
MatchProduct "ThinkPad USB Keyboard with TrackPoint"
+
Option "EmulateWheel" "true
+
Option "EmulateWheelButton" "2"
+
Option "Emulate3Buttons" "false"
+
'''
+
]
+
'';
description = "Content of additional InputClass sections of the X server configuration file.";
};
+13 -12
nixos/modules/system/activation/activation-script.nix
···
system.activationScripts = mkOption {
default = {};
-
example = {
-
stdio = {
-
text = ''
-
# Needed by some programs.
-
ln -sfn /proc/self/fd /dev/fd
-
ln -sfn /proc/self/fd/0 /dev/stdin
-
ln -sfn /proc/self/fd/1 /dev/stdout
-
ln -sfn /proc/self/fd/2 /dev/stderr
-
'';
-
deps = [];
-
};
-
};
+
example = literalExample ''
+
{ stdio = {
+
text = '''
+
# Needed by some programs.
+
ln -sfn /proc/self/fd /dev/fd
+
ln -sfn /proc/self/fd/0 /dev/stdin
+
ln -sfn /proc/self/fd/1 /dev/stdout
+
ln -sfn /proc/self/fd/2 /dev/stderr
+
''';
+
deps = [];
+
};
+
}
+
'';
description = ''
A set of shell script fragments that are executed when a NixOS