From 3e326efffcf962a3d60d169bf18e0ad515fe7dee Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:48:27 +1200 Subject: [PATCH 1/8] nixos/vpnc: fix formatting of example --- nixos/modules/config/vpnc.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nixos/modules/config/vpnc.nix b/nixos/modules/config/vpnc.nix index 68d755232ebe..c7ac1b3530e1 100644 --- a/nixos/modules/config/vpnc.nix +++ b/nixos/modules/config/vpnc.nix @@ -17,16 +17,16 @@ in 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 From 3fc6470515902a60f7f0684e2106a203c3478653 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:49:05 +1200 Subject: [PATCH 2/8] nixos/freetds: fix formatting of example --- nixos/modules/programs/freetds.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nixos/modules/programs/freetds.nix b/nixos/modules/programs/freetds.nix index 398fd104363b..e0860a242b74 100644 --- a/nixos/modules/programs/freetds.nix +++ b/nixos/modules/programs/freetds.nix @@ -17,14 +17,14 @@ in 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 From 24d5d28820d3d85a393dea61bb362ca0e6a2c849 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:49:32 +1200 Subject: [PATCH 3/8] cacert: fix formatting of example --- nixos/modules/security/ca.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/nixos/modules/security/ca.nix b/nixos/modules/security/ca.nix index 8bd634b10a51..849530238e7e 100644 --- a/nixos/modules/security/ca.nix +++ b/nixos/modules/security/ca.nix @@ -35,14 +35,17 @@ in 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. From f6f892e2d64445b7eeab56bec9715ba0ffbae10d Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:50:27 +1200 Subject: [PATCH 4/8] nsd service: fix formatting of example --- nixos/modules/services/networking/nsd.nix | 53 ++++++++++++----------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix index e85f26811257..10566310041e 100644 --- a/nixos/modules/services/networking/nsd.nix +++ b/nixos/modules/services/networking/nsd.nix @@ -621,34 +621,37 @@ in 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 From eb90705d456d1bdd64f8e35f07e4acc34d153f5d Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:51:04 +1200 Subject: [PATCH 5/8] fail2ban service: fix formatting of example --- nixos/modules/services/security/fail2ban.nix | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/security/fail2ban.nix b/nixos/modules/services/security/fail2ban.nix index 1d3e18dcab25..afbd81be91f2 100644 --- a/nixos/modules/services/security/fail2ban.nix +++ b/nixos/modules/services/security/fail2ban.nix @@ -50,20 +50,20 @@ in 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 = '' From 25fd9e31a2bbbc2f907e1cae466fec347fce0f34 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:51:38 +1200 Subject: [PATCH 6/8] phpfpm service: fix formatting of example --- nixos/modules/services/web-servers/phpfpm.nix | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/web-servers/phpfpm.nix b/nixos/modules/services/web-servers/phpfpm.nix index bdd41ed702b5..1b1f3b8d5d0e 100644 --- a/nixos/modules/services/web-servers/phpfpm.nix +++ b/nixos/modules/services/web-servers/phpfpm.nix @@ -52,18 +52,19 @@ in { 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 php-fpm.conf for From c1e674c4ca28a4f8871a57efa0dde36852e51cbb Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:52:50 +1200 Subject: [PATCH 7/8] xserver service: fix formatting of example --- nixos/modules/services/x11/xserver.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 653c97d7e6fa..cfe5e7f960c7 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -156,13 +156,16 @@ in 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."; }; From 392ca77d4c0c5e05ad23378de370ea964c29848f Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 4 Jul 2015 18:53:26 +1200 Subject: [PATCH 8/8] nixos/activation-script: fix formatting of example --- .../system/activation/activation-script.nix | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index d78ec0d7bf3d..854fa2f40b69 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -30,18 +30,19 @@ in 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