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

nixos: fix formatting of option examples
This commit is contained in:
Domen Kožar 2016-02-27 10:08:37 +00:00
commit 04422bb3ca
8 changed files with 107 additions and 96 deletions

View File

@ -17,16 +17,16 @@ in
services = mkOption { services = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = {};
example = { example = literalExample ''
test = { test = '''
''
IPSec gateway 192.168.1.1 IPSec gateway 192.168.1.1
IPSec ID someID IPSec ID someID
IPSec secret secretKey IPSec secret secretKey
Xauth username name Xauth username name
Xauth password pass Xauth password pass
''';
}
''; '';
};
description = description =
'' ''
The names of cisco VPNs and their associated definitions The names of cisco VPNs and their associated definitions

View File

@ -17,14 +17,14 @@ in
environment.freetds = mkOption { environment.freetds = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = {};
example = { example = literalExample ''
MYDATABASE = { MYDATABASE = '''
''
host = 10.0.2.100 host = 10.0.2.100
port = 1433 port = 1433
tds version = 7.2 tds version = 7.2
''';
}
''; '';
};
description = description =
'' ''
Configure freetds database entries. Each attribute denotes Configure freetds database entries. Each attribute denotes

View File

@ -35,7 +35,8 @@ in
security.pki.certificates = mkOption { security.pki.certificates = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [];
example = singleton '' example = literalExample ''
[ '''
NixOS.org NixOS.org
========= =========
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
@ -43,6 +44,8 @@ in
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0 TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
... ...
-----END CERTIFICATE----- -----END CERTIFICATE-----
'''
]
''; '';
description = '' description = ''
A list of trusted root certificates in PEM format. A list of trusted root certificates in PEM format.

View File

@ -621,34 +621,37 @@ in
zones = mkOption { zones = mkOption {
type = types.attrsOf zoneOptions; type = types.attrsOf zoneOptions;
default = {}; default = {};
example = { example = literalExample ''
"serverGroup1" = { { "serverGroup1" = {
provideXFR = [ "10.1.2.3 NOKEY" ]; provideXFR = [ "10.1.2.3 NOKEY" ];
children = { children = {
"example.com." = { "example.com." = {
data = '' data = '''
$ORIGIN example.com. $ORIGIN example.com.
$TTL 86400 $TTL 86400
@ IN SOA a.ns.example.com. admin.example.com. ( @ IN SOA a.ns.example.com. admin.example.com. (
... ...
''; ''';
}; };
"example.org." = { "example.org." = {
data = '' data = '''
$ORIGIN example.org. $ORIGIN example.org.
$TTL 86400 $TTL 86400
@ IN SOA a.ns.example.com. admin.example.com. ( @ IN SOA a.ns.example.com. admin.example.com. (
... ...
''; ''';
}; };
}; };
}; };
"example.net." = { "example.net." = {
provideXFR = [ "10.3.2.1 NOKEY" ]; provideXFR = [ "10.3.2.1 NOKEY" ];
data = ''...''; data = '''
}; ...
''';
}; };
}
'';
description = '' description = ''
Define your zones here. Zones can cascade other zones and therefore Define your zones here. Zones can cascade other zones and therefore
inherit settings from parent zones. Look at the definition of inherit settings from parent zones. Look at the definition of

View File

@ -50,9 +50,8 @@ in
jails = mkOption { jails = mkOption {
default = { }; default = { };
example = example = literalExample ''
{ "apache-nohome-iptables" = { apache-nohome-iptables = '''
''
# Block an IP address if it accesses a non-existent # Block an IP address if it accesses a non-existent
# home directory more than 5 times in 10 minutes, # home directory more than 5 times in 10 minutes,
# since that indicates that it's scanning. # since that indicates that it's scanning.
@ -62,8 +61,9 @@ in
findtime = 600 findtime = 600
bantime = 600 bantime = 600
maxretry = 5 maxretry = 5
''';
}
''; '';
};
type = types.attrsOf types.lines; type = types.attrsOf types.lines;
description = description =
'' ''

View File

@ -53,8 +53,8 @@ in {
poolConfigs = mkOption { poolConfigs = mkOption {
type = types.attrsOf types.lines; type = types.attrsOf types.lines;
default = {}; default = {};
example = { example = literalExample ''
mypool = '' { mypool = '''
listen = /run/phpfpm/mypool listen = /run/phpfpm/mypool
user = nobody user = nobody
pm = dynamic pm = dynamic
@ -63,8 +63,9 @@ in {
pm.min_spare_servers = 5 pm.min_spare_servers = 5
pm.max_spare_servers = 20 pm.max_spare_servers = 20
pm.max_requests = 500 pm.max_requests = 500
''';
}
''; '';
};
description = '' description = ''
A mapping between PHP FPM pool names and their configurations. A mapping between PHP FPM pool names and their configurations.
See the documentation on <literal>php-fpm.conf</literal> for See the documentation on <literal>php-fpm.conf</literal> for

View File

@ -156,13 +156,16 @@ in
inputClassSections = mkOption { inputClassSections = mkOption {
type = types.listOf types.lines; type = types.listOf types.lines;
default = []; default = [];
example = [ '' example = literalExample ''
[ '''
Identifier "Trackpoint Wheel Emulation" Identifier "Trackpoint Wheel Emulation"
MatchProduct "ThinkPad USB Keyboard with TrackPoint" MatchProduct "ThinkPad USB Keyboard with TrackPoint"
Option "EmulateWheel" "true Option "EmulateWheel" "true
Option "EmulateWheelButton" "2" Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false" Option "Emulate3Buttons" "false"
'' ]; '''
]
'';
description = "Content of additional InputClass sections of the X server configuration file."; description = "Content of additional InputClass sections of the X server configuration file.";
}; };

View File

@ -30,18 +30,19 @@ in
system.activationScripts = mkOption { system.activationScripts = mkOption {
default = {}; default = {};
example = { example = literalExample ''
stdio = { { stdio = {
text = '' text = '''
# Needed by some programs. # Needed by some programs.
ln -sfn /proc/self/fd /dev/fd ln -sfn /proc/self/fd /dev/fd
ln -sfn /proc/self/fd/0 /dev/stdin ln -sfn /proc/self/fd/0 /dev/stdin
ln -sfn /proc/self/fd/1 /dev/stdout ln -sfn /proc/self/fd/1 /dev/stdout
ln -sfn /proc/self/fd/2 /dev/stderr ln -sfn /proc/self/fd/2 /dev/stderr
''; ''';
deps = []; deps = [];
}; };
}; }
'';
description = '' description = ''
A set of shell script fragments that are executed when a NixOS A set of shell script fragments that are executed when a NixOS