0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos-modules: Fixes related to "literalExample" and "defaultText".

This commit is contained in:
Thomas Strobel 2016-02-29 01:47:12 +01:00
parent cad8957eab
commit 2d6696fc0a
4 changed files with 12 additions and 9 deletions

View file

@ -85,7 +85,7 @@ in
type = types.lines; type = types.lines;
default = ''stdin { type => "example" }''; default = ''stdin { type => "example" }'';
description = "Logstash input configuration."; description = "Logstash input configuration.";
example = literalExample '' example = ''
# Read from journal # Read from journal
pipe { pipe {
command => "''${pkgs.systemd}/bin/journalctl -f -o json" command => "''${pkgs.systemd}/bin/journalctl -f -o json"
@ -98,7 +98,7 @@ in
type = types.lines; type = types.lines;
default = ''noop {}''; default = ''noop {}'';
description = "logstash filter configuration."; description = "logstash filter configuration.";
example = literalExample '' example = ''
if [type] == "syslog" { if [type] == "syslog" {
# Keep only relevant systemd fields # Keep only relevant systemd fields
# http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html # http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
@ -114,7 +114,7 @@ in
outputConfig = mkOption { outputConfig = mkOption {
type = types.lines; type = types.lines;
default = literalExample ''stdout { debug => true debug_format => "json"}''; default = ''stdout { debug => true debug_format => "json"}'';
description = "Logstash output configuration."; description = "Logstash output configuration.";
example = '' example = ''
redis { host => "localhost" data_type => "list" key => "logstash" codec => json } redis { host => "localhost" data_type => "list" key => "logstash" codec => json }

View file

@ -62,7 +62,9 @@ in
}; };
plugins = mkOption { plugins = mkOption {
type = types.functionTo (types.listOf types.package);
default = plugins: []; default = plugins: [];
defaultText = "plugins: []";
example = literalExample "plugins: [ m3d-fio ]"; example = literalExample "plugins: [ m3d-fio ]";
description = "Additional plugins."; description = "Additional plugins.";
}; };

View file

@ -559,7 +559,7 @@ in
algorithm = "hmac-md5"; algorithm = "hmac-md5";
keyFile = "/path/to/my/key"; keyFile = "/path/to/my/key";
}; };
}; }
''; '';
description = '' description = ''
Define your TSIG keys here. Define your TSIG keys here.
@ -719,7 +719,7 @@ in
... ...
'''; ''';
}; };
}; }
''; '';
description = '' description = ''
Define your zones here. Zones can cascade other zones and therefore Define your zones here. Zones can cascade other zones and therefore

View file

@ -78,10 +78,11 @@ in {
''; '';
default = {}; default = {};
example = literalExample '' example = literalExample ''
echelon = { { echelon = {
psk = "abcdefgh"; psk = "abcdefgh";
}; };
"free.wifi" = {}; "free.wifi" = {};
}
''; '';
}; };