Add missing 'type', 'defaultText' and 'literalExample' in module definitions

- add missing types in module definitions
- add missing 'defaultText' in module definitions
- wrap example with 'literalExample' where necessary in module definitions
This commit is contained in:
Thomas Strobel 2016-01-17 19:34:55 +01:00
parent ae5ef2b009
commit a04a7272aa
81 changed files with 175 additions and 97 deletions

View File

@ -57,6 +57,7 @@ in
users.ldap = { users.ldap = {
enable = mkOption { enable = mkOption {
type = types.bool;
default = false; default = false;
description = "Whether to enable authentication against an LDAP server."; description = "Whether to enable authentication against an LDAP server.";
}; };

View File

@ -99,6 +99,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pulseaudioLight; default = pulseaudioLight;
defaultText = "pkgs.pulseaudioLight";
example = literalExample "pkgs.pulseaudioFull"; example = literalExample "pkgs.pulseaudioFull";
description = '' description = ''
The PulseAudio derivation to use. This can be used to enable The PulseAudio derivation to use. This can be used to enable

View File

@ -119,6 +119,7 @@ in
environment.binsh = mkOption { environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh"; default = "${config.system.build.binsh}/bin/sh";
defaultText = "\${config.system.build.binsh}/bin/sh";
example = literalExample '' example = literalExample ''
"''${pkgs.dash}/bin/dash" "''${pkgs.dash}/bin/dash"
''; '';

View File

@ -10,8 +10,9 @@ with lib;
options = { options = {
environment.unixODBCDrivers = mkOption { environment.unixODBCDrivers = mkOption {
type = types.listOf types.package;
default = []; default = [];
example = literalExample "map (x : x.ini) (with pkgs.unixODBCDrivers; [ mysql psql psqlng ] )"; example = literalExample "with pkgs.unixODBCDrivers; [ mysql psql psqlng ]";
description = '' description = ''
Specifies Unix ODBC drivers to be registered in Specifies Unix ODBC drivers to be registered in
<filename>/etc/odbcinst.ini</filename>. You may also want to <filename>/etc/odbcinst.ini</filename>. You may also want to
@ -26,7 +27,7 @@ with lib;
config = mkIf (config.environment.unixODBCDrivers != []) { config = mkIf (config.environment.unixODBCDrivers != []) {
environment.etc."odbcinst.ini".text = environment.etc."odbcinst.ini".text =
let inis = config.environment.unixODBCDrivers; let inis = map (x : x.ini) config.environment.unixODBCDrivers;
in lib.concatStringsSep "\n" inis; in lib.concatStringsSep "\n" inis;
}; };

View File

@ -24,6 +24,7 @@ in
''; '';
}; };
kernelPackages = mkOption { kernelPackages = mkOption {
type = types.package;
default = pkgs.linuxPackages; default = pkgs.linuxPackages;
# We don't want to evaluate all of linuxPackages for the manual # We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly. # - some of it might not even evaluate correctly.

View File

@ -37,8 +37,8 @@ with lib;
nixos.extraModules = mkOption { nixos.extraModules = mkOption {
default = []; default = [];
example = literalExample "mkIf config.services.openssh.enable [ ./sshd-config.nix ]"; example = literalExample "[ ./sshd-config.nix ]";
type = types.listOf types.unspecified; type = types.listOf (types.either (types.submodule ({...}:{options={};})) types.path);
description = '' description = ''
Define additional modules which would be loaded to evaluate the Define additional modules which would be loaded to evaluate the
configuration. configuration.

View File

@ -93,7 +93,9 @@ in
}; };
package = mkOption { package = mkOption {
type = types.package;
default = pkgs.openssh; default = pkgs.openssh;
defaultText = "pkgs.openssh";
description = '' description = ''
The package used for the openssh client and daemon. The package used for the openssh client and daemon.
''; '';
@ -142,16 +144,18 @@ in
description = '' description = ''
The set of system-wide known SSH hosts. The set of system-wide known SSH hosts.
''; '';
example = [ example = literalExample ''
[
{ {
hostNames = [ "myhost" "myhost.mydomain.com" "10.10.1.4" ]; hostNames = [ "myhost" "myhost.mydomain.com" "10.10.1.4" ];
publicKeyFile = literalExample "./pubkeys/myhost_ssh_host_dsa_key.pub"; publicKeyFile = "./pubkeys/myhost_ssh_host_dsa_key.pub";
} }
{ {
hostNames = [ "myhost2" ]; hostNames = [ "myhost2" ];
publicKeyFile = literalExample "./pubkeys/myhost2_ssh_host_dsa_key.pub"; publicKeyFile = "./pubkeys/myhost2_ssh_host_dsa_key.pub";
} }
]; ]
'';
}; };
}; };

View File

@ -46,7 +46,7 @@ in
example = { example = {
myStream1 = literalExample "\"/etc/liquidsoap/myStream1.liq\""; myStream1 = literalExample "\"/etc/liquidsoap/myStream1.liq\"";
myStream2 = literalExample "./myStream2.liq"; myStream2 = literalExample "./myStream2.liq";
myStream3 = literalExample "\"out(playlist(\"/srv/music/\"))\""; myStream3 = literalExample "\"out(playlist(\\\"/srv/music/\\\"))\"";
}; };
type = types.attrsOf (types.either types.path types.str); type = types.attrsOf (types.either types.path types.str);

View File

@ -207,7 +207,7 @@ in {
description = '' description = ''
Extra configuration to be passed in Client directive. Extra configuration to be passed in Client directive.
''; '';
example = literalExample '' example = ''
Maximum Concurrent Jobs = 20; Maximum Concurrent Jobs = 20;
Heartbeat Interval = 30; Heartbeat Interval = 30;
''; '';
@ -218,7 +218,7 @@ in {
description = '' description = ''
Extra configuration to be passed in Messages directive. Extra configuration to be passed in Messages directive.
''; '';
example = literalExample '' example = ''
console = all console = all
''; '';
}; };

View File

@ -43,6 +43,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.rsnapshot; default = pkgs.rsnapshot;
defaultText = "pkgs.rsnapshot";
example = literalExample "pkgs.rsnapshotGit"; example = literalExample "pkgs.rsnapshotGit";
description = '' description = ''
RSnapshot package to use. RSnapshot package to use.

View File

@ -80,6 +80,7 @@ in {
packages = mkOption { packages = mkOption {
default = [ pkgs.stdenv pkgs.git pkgs.jdk config.programs.ssh.package pkgs.nix ]; default = [ pkgs.stdenv pkgs.git pkgs.jdk config.programs.ssh.package pkgs.nix ];
defaultText = "[ pkgs.stdenv pkgs.git pkgs.jdk config.programs.ssh.package pkgs.nix ]";
type = types.listOf types.package; type = types.listOf types.package;
description = '' description = ''
Packages to add to PATH for the jenkins process. Packages to add to PATH for the jenkins process.

View File

@ -74,7 +74,7 @@ in {
]; ];
}; };
} }
]; ]
''; '';
description = '' description = ''
Job descriptions for Jenkins Job Builder in Nix format. Job descriptions for Jenkins Job Builder in Nix format.

View File

@ -38,6 +38,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.couchdb; default = pkgs.couchdb;
defaultText = "pkgs.couchdb";
example = literalExample "pkgs.couchdb"; example = literalExample "pkgs.couchdb";
description = '' description = ''
CouchDB package to use. CouchDB package to use.

View File

@ -49,6 +49,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.firebirdSuper; default = pkgs.firebirdSuper;
defaultText = "pkgs.firebirdSuper";
type = types.package; type = types.package;
/* /*
Example: <code>package = pkgs.firebirdSuper.override { icu = Example: <code>package = pkgs.firebirdSuper.override { icu =

View File

@ -44,6 +44,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.hbase; default = pkgs.hbase;
defaultText = "pkgs.hbase";
example = literalExample "pkgs.hbase"; example = literalExample "pkgs.hbase";
description = '' description = ''
HBase package to use. HBase package to use.

View File

@ -120,6 +120,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.influxdb; default = pkgs.influxdb;
defaultText = "pkgs.influxdb";
description = "Which influxdb derivation to use"; description = "Which influxdb derivation to use";
type = types.package; type = types.package;
}; };

View File

@ -41,6 +41,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.mongodb; default = pkgs.mongodb;
defaultText = "pkgs.mongodb";
type = types.package; type = types.package;
description = " description = "
Which MongoDB derivation to use. Which MongoDB derivation to use.

View File

@ -49,6 +49,7 @@ in {
package = mkOption { package = mkOption {
description = "Neo4j package to use."; description = "Neo4j package to use.";
default = pkgs.neo4j; default = pkgs.neo4j;
defaultText = "pkgs.neo4j";
type = types.package; type = types.package;
}; };

View File

@ -25,22 +25,7 @@ in
description = " description = "
Whether to enable the ldap server. Whether to enable the ldap server.
"; ";
example = literalExample '' example = true;
openldap.enable = true;
openldap.extraConfig = '''
include ''${pkgs.openldap}/etc/openldap/schema/core.schema
include ''${pkgs.openldap}/etc/openldap/schema/cosine.schema
include ''${pkgs.openldap}/etc/openldap/schema/inetorgperson.schema
include ''${pkgs.openldap}/etc/openldap/schema/nis.schema
database bdb
suffix dc=example,dc=org
rootdn cn=admin,dc=example,dc=org
# NOTE: change after first start
rootpw secret
directory /var/db/openldap
''';
'';
}; };
user = mkOption { user = mkOption {
@ -67,6 +52,19 @@ in
description = " description = "
sldapd.conf configuration sldapd.conf configuration
"; ";
example = ''
include ''${pkgs.openldap}/etc/openldap/schema/core.schema
include ''${pkgs.openldap}/etc/openldap/schema/cosine.schema
include ''${pkgs.openldap}/etc/openldap/schema/inetorgperson.schema
include ''${pkgs.openldap}/etc/openldap/schema/nis.schema
database bdb
suffix dc=example,dc=org
rootdn cn=admin,dc=example,dc=org
# NOTE: change after first start
rootpw secret
directory /var/db/openldap
'';
}; };
}; };

View File

@ -26,6 +26,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.opentsdb; default = pkgs.opentsdb;
defaultText = "pkgs.opentsdb";
example = literalExample "pkgs.opentsdb"; example = literalExample "pkgs.opentsdb";
description = '' description = ''
OpenTSDB package to use. OpenTSDB package to use.

View File

@ -46,6 +46,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.redis; default = pkgs.redis;
defaultText = "pkgs.redis";
description = "Which Redis derivation to use."; description = "Which Redis derivation to use.";
}; };

View File

@ -21,6 +21,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.freefall; default = pkgs.freefall;
defaultText = "pkgs.freefall";
description = '' description = ''
freefall derivation to use. freefall derivation to use.
''; '';

View File

@ -27,6 +27,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.upower; default = pkgs.upower;
defaultText = "pkgs.upower";
example = lib.literalExample "pkgs.upower"; example = lib.literalExample "pkgs.upower";
description = '' description = ''
Which upower package to use. Which upower package to use.

View File

@ -13,6 +13,7 @@ in
options = { options = {
services.logrotate = { services.logrotate = {
enable = mkOption { enable = mkOption {
type = lib.types.bool;
default = false; default = false;
description = '' description = ''
Enable the logrotate cron job Enable the logrotate cron job

View File

@ -33,6 +33,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.logstash; default = pkgs.logstash;
defaultText = "pkgs.logstash";
example = literalExample "pkgs.logstash"; example = literalExample "pkgs.logstash";
description = "Logstash package to use."; description = "Logstash package to use.";
}; };
@ -84,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"

View File

@ -39,6 +39,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.syslogng; default = pkgs.syslogng;
defaultText = "pkgs.syslogng";
description = '' description = ''
The package providing syslog-ng binaries. The package providing syslog-ng binaries.
''; '';

View File

@ -90,6 +90,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.dovecot22; default = pkgs.dovecot22;
defaultText = "pkgs.dovecot22";
description = "Dovecot package to use."; description = "Dovecot package to use.";
}; };
@ -131,7 +132,7 @@ in
modules = mkOption { modules = mkOption {
type = types.listOf types.package; type = types.listOf types.package;
default = []; default = [];
example = [ pkgs.dovecot_pigeonhole ]; example = literalExample "[ pkgs.dovecot_pigeonhole ]";
description = '' description = ''
Symlinks the contents of lib/dovecot of every given package into Symlinks the contents of lib/dovecot of every given package into
/var/lib/dovecot/modules. This will make the given modules available /var/lib/dovecot/modules. This will make the given modules available

View File

@ -118,9 +118,8 @@ in {
package = mkOption { package = mkOption {
description = "The kafka package to use"; description = "The kafka package to use";
default = pkgs.apacheKafka; default = pkgs.apacheKafka;
defaultText = "pkgs.apacheKafka";
type = types.package; type = types.package;
}; };

View File

@ -27,8 +27,9 @@ in
}; };
autoMaster = mkOption { autoMaster = mkOption {
type = types.str;
example = literalExample '' example = literalExample ''
autoMaster = let let
mapConf = pkgs.writeText "auto" ''' mapConf = pkgs.writeText "auto" '''
kernel -ro,soft,intr ftp.kernel.org:/pub/linux kernel -ro,soft,intr ftp.kernel.org:/pub/linux
boot -fstype=ext2 :/dev/hda1 boot -fstype=ext2 :/dev/hda1

View File

@ -41,6 +41,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.cgminer; default = pkgs.cgminer;
defaultText = "pkgs.cgminer";
description = "Which cgminer derivation to use."; description = "Which cgminer derivation to use.";
type = types.package; type = types.package;
}; };

View File

@ -64,6 +64,7 @@ in {
package = mkOption { package = mkOption {
description = "Confd package to use."; description = "Confd package to use.";
default = pkgs.confd; default = pkgs.confd;
defaultText = "pkgs.confd";
type = types.package; type = types.package;
}; };
}; };

View File

@ -77,11 +77,11 @@ in {
default = {}; default = {};
example = literalExample '' example = literalExample ''
{ {
"CORS": "*", "CORS" = "*";
"NAME": "default-name", "NAME" = "default-name";
"MAX_RESULT_BUFFER": "1024", "MAX_RESULT_BUFFER" = "1024";
"MAX_CLUSTER_SIZE": "9", "MAX_CLUSTER_SIZE" = "9";
"MAX_RETRY_ATTEMPTS": "3" "MAX_RETRY_ATTEMPTS" = "3";
} }
''; '';
}; };

View File

@ -23,7 +23,9 @@ in
}; };
bundles = mkOption { bundles = mkOption {
type = types.listOf types.package;
default = [ pkgs.felix_remoteshell ]; default = [ pkgs.felix_remoteshell ];
defaultText = "[ pkgs.felix_remoteshell ]";
description = "List of bundles that should be activated on startup"; description = "List of bundles that should be activated on startup";
}; };

View File

@ -35,6 +35,7 @@ let
}; };
haskellPackages = mkOption { haskellPackages = mkOption {
type = types.attrsOf types.package;
default = pkgs.haskellPackages; default = pkgs.haskellPackages;
defaultText = "pkgs.haskellPackages"; defaultText = "pkgs.haskellPackages";
example = literalExample "pkgs.haskell.packages.ghc784"; example = literalExample "pkgs.haskell.packages.ghc784";

View File

@ -22,6 +22,7 @@ in
}; };
haskellPackages = mkOption { haskellPackages = mkOption {
type = types.attrsOf types.package;
default = pkgs.haskellPackages; default = pkgs.haskellPackages;
defaultText = "pkgs.haskellPackages"; defaultText = "pkgs.haskellPackages";
example = literalExample "pkgs.haskell.packages.ghc784"; example = literalExample "pkgs.haskell.packages.ghc784";

View File

@ -17,7 +17,9 @@ in {
}; };
package = mkOption { package = mkOption {
type = types.package;
default = pkgs.mbpfan; default = pkgs.mbpfan;
defaultText = "pkgs.mbpfan";
description = '' description = ''
The package used for the mbpfan daemon. The package used for the mbpfan daemon.
''; '';

View File

@ -66,6 +66,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.nix; default = pkgs.nix;
defaultText = "pkgs.nix";
description = '' description = ''
This option specifies the Nix package instance to use throughout the system. This option specifies the Nix package instance to use throughout the system.
''; '';

View File

@ -208,6 +208,7 @@ in
description = "Which rippled package to use."; description = "Which rippled package to use.";
type = types.package; type = types.package;
default = pkgs.rippled; default = pkgs.rippled;
defaultText = "pkgs.rippled";
}; };
ports = mkOption { ports = mkOption {
@ -238,7 +239,7 @@ in
nodeDb = mkOption { nodeDb = mkOption {
description = "Rippled main database options."; description = "Rippled main database options.";
type = types.nullOr types.optionSet; type = types.nullOr types.optionSet;
options = [dbOptions]; options = dbOptions;
default = { default = {
type = "rocksdb"; type = "rocksdb";
extraOpts = '' extraOpts = ''
@ -254,14 +255,14 @@ in
tempDb = mkOption { tempDb = mkOption {
description = "Rippled temporary database options."; description = "Rippled temporary database options.";
type = types.nullOr types.optionSet; type = types.nullOr types.optionSet;
options = [dbOptions]; options = dbOptions;
default = null; default = null;
}; };
importDb = mkOption { importDb = mkOption {
description = "Settings for performing a one-time import."; description = "Settings for performing a one-time import.";
type = types.nullOr types.optionSet; type = types.nullOr types.optionSet;
options = [dbOptions]; options = dbOptions;
default = null; default = null;
}; };

View File

@ -33,6 +33,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.bosun; default = pkgs.bosun;
defaultText = "pkgs.bosun";
example = literalExample "pkgs.bosun"; example = literalExample "pkgs.bosun";
description = '' description = ''
bosun binary to use. bosun binary to use.

View File

@ -93,6 +93,7 @@ in {
package = mkOption { package = mkOption {
description = "Package to use."; description = "Package to use.";
default = pkgs.grafana; default = pkgs.grafana;
defaultText = "pkgs.grafana";
type = types.package; type = types.package;
}; };

View File

@ -108,7 +108,7 @@ in {
finders = mkOption { finders = mkOption {
description = "List of finder plugins to load."; description = "List of finder plugins to load.";
default = []; default = [];
example = [ pkgs.python27Packages.graphite_influxdb ]; example = literalExample "[ pkgs.python27Packages.graphite_influxdb ]";
type = types.listOf types.package; type = types.listOf types.package;
}; };
@ -136,6 +136,7 @@ in {
package = mkOption { package = mkOption {
description = "Package to use for graphite api."; description = "Package to use for graphite api.";
default = pkgs.python27Packages.graphite_api; default = pkgs.python27Packages.graphite_api;
defaultText = "pkgs.python27Packages.graphite_api";
type = types.package; type = types.package;
}; };
@ -146,7 +147,7 @@ in {
directories: directories:
- ${dataDir}/whisper - ${dataDir}/whisper
''; '';
example = literalExample '' example = ''
allowed_origins: allowed_origins:
- dashboard.example.com - dashboard.example.com
cheat_times: true cheat_times: true
@ -350,7 +351,7 @@ in {
critical: 200 critical: 200
name: Test name: Test
''; '';
example = literalExample '' example = ''
pushbullet_key: pushbullet_api_key pushbullet_key: pushbullet_api_key
alerts: alerts:
- target: stats.seatgeek.app.deal_quality.venue_info_cache.hit - target: stats.seatgeek.app.deal_quality.venue_info_cache.hit

View File

@ -33,6 +33,7 @@ in {
package = mkOption { package = mkOption {
description = "Package to use by heapster"; description = "Package to use by heapster";
default = pkgs.heapster; default = pkgs.heapster;
defaultText = "pkgs.heapster";
type = types.package; type = types.package;
}; };
}; };

View File

@ -122,21 +122,6 @@ in
HTML output is in <filename>/var/www/munin/</filename>, configure your HTML output is in <filename>/var/www/munin/</filename>, configure your
favourite webserver to serve static files. favourite webserver to serve static files.
''; '';
example = literalExample ''
services = {
munin-node.enable = true;
munin-cron = {
enable = true;
hosts = '''
[''${config.networking.hostName}]
address localhost
''';
extraGlobalConfig = '''
contact.email.command mail -s "Munin notification for ''${var:host}" someone@example.com
''';
};
};
'';
}; };
extraGlobalConfig = mkOption { extraGlobalConfig = mkOption {
@ -147,6 +132,9 @@ in
Useful to setup notifications, see Useful to setup notifications, see
<link xlink:href='http://munin-monitoring.org/wiki/HowToContact' /> <link xlink:href='http://munin-monitoring.org/wiki/HowToContact' />
''; '';
example = ''
contact.email.command mail -s "Munin notification for ''${var:host}" someone@example.com
'';
}; };
hosts = mkOption { hosts = mkOption {

View File

@ -94,7 +94,9 @@ in
}; };
plugins = mkOption { plugins = mkOption {
type = types.listOf types.package;
default = [pkgs.nagiosPluginsOfficial pkgs.ssmtp]; default = [pkgs.nagiosPluginsOfficial pkgs.ssmtp];
defaultText = "[pkgs.nagiosPluginsOfficial pkgs.ssmtp]";
description = " description = "
Packages to be added to the Nagios <envar>PATH</envar>. Packages to be added to the Nagios <envar>PATH</envar>.
Typically used to add plugins, but can be anything. Typically used to add plugins, but can be anything.
@ -102,14 +104,18 @@ in
}; };
mainConfigFile = mkOption { mainConfigFile = mkOption {
type = types.package;
default = nagiosCfgFile; default = nagiosCfgFile;
defaultText = "nagiosCfgFile";
description = " description = "
Derivation for the main configuration file of Nagios. Derivation for the main configuration file of Nagios.
"; ";
}; };
cgiConfigFile = mkOption { cgiConfigFile = mkOption {
type = types.package;
default = nagiosCGICfgFile; default = nagiosCGICfgFile;
defaultText = "nagiosCGICfgFile";
description = " description = "
Derivation for the configuration file of Nagios CGI scripts Derivation for the configuration file of Nagios CGI scripts
that can be used in web servers for running the Nagios web interface. that can be used in web servers for running the Nagios web interface.

View File

@ -43,6 +43,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.scollector; default = pkgs.scollector;
defaultText = "pkgs.scollector";
example = literalExample "pkgs.scollector"; example = literalExample "pkgs.scollector";
description = '' description = ''
scollector binary to use. scollector binary to use.
@ -77,7 +78,7 @@ in {
collectors = mkOption { collectors = mkOption {
type = with types; attrsOf (listOf path); type = with types; attrsOf (listOf path);
default = {}; default = {};
example = literalExample "{ 0 = [ \"\${postgresStats}/bin/collect-stats\" ]; }"; example = literalExample "{ \"0\" = [ \"\${postgresStats}/bin/collect-stats\" ]; }";
description = '' description = ''
An attribute set mapping the frequency of collection to a list of An attribute set mapping the frequency of collection to a list of
binaries that should be executed at that frequency. You can use "0" binaries that should be executed at that frequency. You can use "0"

View File

@ -85,7 +85,8 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.samba; default = pkgs.samba;
example = pkgs.samba4; defaultText = "pkgs.samba";
example = literalExample "pkgs.samba4";
description = '' description = ''
Defines which package should be used for the samba server. Defines which package should be used for the samba server.
''; '';

View File

@ -120,7 +120,9 @@ in
}; };
configFile = mkOption { configFile = mkOption {
type = types.path;
default = confFile; default = confFile;
defaultText = "confFile";
description = " description = "
Overridable config file to use for named. By default, that Overridable config file to use for named. By default, that
generated by nixos. generated by nixos.

View File

@ -118,6 +118,7 @@ in
package = mkOption { package = mkOption {
description = "Package to use for consul-alerts."; description = "Package to use for consul-alerts.";
default = pkgs.consul-alerts; default = pkgs.consul-alerts;
defaultText = "pkgs.consul-alerts";
type = types.package; type = types.package;
}; };

View File

@ -421,8 +421,9 @@ in
}; };
networking.firewall.extraPackages = mkOption { networking.firewall.extraPackages = mkOption {
type = types.listOf types.package;
default = [ ]; default = [ ];
example = [ pkgs.ipset ]; example = literalExample "[ pkgs.ipset ]";
description = description =
'' ''
Additional packages to be included in the environment of the system Additional packages to be included in the environment of the system

View File

@ -27,6 +27,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.lambdabot; default = pkgs.lambdabot;
defaultText = "pkgs.lambdabot";
description = "Used lambdabot package"; description = "Used lambdabot package";
}; };

View File

@ -110,7 +110,7 @@ in {
# Ugly hack for using the correct gnome3 packageSet # Ugly hack for using the correct gnome3 packageSet
basePackages = mkOption { basePackages = mkOption {
type = types.attrsOf types.path; type = types.attrsOf types.package;
default = { inherit networkmanager modemmanager wpa_supplicant default = { inherit networkmanager modemmanager wpa_supplicant
networkmanager_openvpn networkmanager_vpnc networkmanager_openvpn networkmanager_vpnc
networkmanager_openconnect networkmanager_openconnect

View File

@ -34,6 +34,7 @@ in {
type = types.package; type = types.package;
default = pkgs.ngircd; default = pkgs.ngircd;
defaultText = "pkgs.ngircd";
}; };
}; };
}; };

View File

@ -56,6 +56,7 @@ in {
package = mkOption { package = mkOption {
default = pkgs.skydns; default = pkgs.skydns;
defaultText = "pkgs.skydns";
type = types.package; type = types.package;
description = "Skydns package to use."; description = "Skydns package to use.";
}; };

View File

@ -115,7 +115,7 @@ in
path = mkOption { path = mkOption {
type = types.path; type = types.path;
example = "/etc/wpa_supplicant.conf"; example = literalExample "/etc/wpa_supplicant.conf";
description = '' description = ''
External <literal>wpa_supplicant.conf</literal> configuration file. External <literal>wpa_supplicant.conf</literal> configuration file.
The configuration options defined declaratively within <literal>networking.supplicant</literal> have The configuration options defined declaratively within <literal>networking.supplicant</literal> have

View File

@ -43,6 +43,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.syncthing; default = pkgs.syncthing;
defaultText = "pkgs.syncthing";
example = literalExample "pkgs.syncthing"; example = literalExample "pkgs.syncthing";
description = '' description = ''
Syncthing package to use. Syncthing package to use.

View File

@ -87,7 +87,9 @@ in
}; };
package = mkOption { package = mkOption {
type = types.package;
default = pkgs.tinc_pre; default = pkgs.tinc_pre;
defaultText = "pkgs.tinc_pre";
description = '' description = ''
The package to use for the tinc daemon's binary. The package to use for the tinc daemon's binary.
''; '';

View File

@ -120,7 +120,9 @@ in
}; };
userlistFile = mkOption { userlistFile = mkOption {
type = types.path;
default = pkgs.writeText "userlist" (concatMapStrings (x: "${x}\n") cfg.userlist); default = pkgs.writeText "userlist" (concatMapStrings (x: "${x}\n") cfg.userlist);
defaultText = "pkgs.writeText \"userlist\" (concatMapStrings (x: \"\${x}\n\") cfg.userlist)";
description = '' description = ''
Newline separated list of names to be allowed/denied if <option>userlistEnable</option> Newline separated list of names to be allowed/denied if <option>userlistEnable</option>
is <literal>true</literal>. Meaning see <option>userlistDeny</option>. is <literal>true</literal>. Meaning see <option>userlistDeny</option>.

View File

@ -40,6 +40,7 @@ in {
package = mkOption { package = mkOption {
description = "Elasticsearch package to use."; description = "Elasticsearch package to use.";
default = pkgs.elasticsearch; default = pkgs.elasticsearch;
defaultText = "pkgs.elasticsearch";
type = types.package; type = types.package;
}; };

View File

@ -127,6 +127,7 @@ in {
package = mkOption { package = mkOption {
description = "Kibana package to use"; description = "Kibana package to use";
default = pkgs.kibana; default = pkgs.kibana;
defaultText = "pkgs.kibana";
type = types.package; type = types.package;
}; };

View File

@ -45,6 +45,7 @@ in {
javaPackage = mkOption { javaPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.jre; default = pkgs.jre;
defaultText = "pkgs.jre";
description = '' description = ''
Which Java derivation to use for running solr. Which Java derivation to use for running solr.
''; '';
@ -53,6 +54,7 @@ in {
solrPackage = mkOption { solrPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.solr; default = pkgs.solr;
defaultText = "pkgs.solr";
description = '' description = ''
Which solr derivation to use for running solr. Which solr derivation to use for running solr.
''; '';

View File

@ -429,6 +429,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.apacheHttpd; default = pkgs.apacheHttpd;
defaultText = "pkgs.apacheHttpd";
description = '' description = ''
Overridable attribute of the Apache HTTP Server package to use. Overridable attribute of the Apache HTTP Server package to use.
''; '';
@ -437,7 +438,8 @@ in
configFile = mkOption { configFile = mkOption {
type = types.path; type = types.path;
default = confFile; default = confFile;
example = literalExample ''pkgs.writeText "httpd.conf" "# my custom config file ...";''; defaultText = "confFile";
example = literalExample ''pkgs.writeText "httpd.conf" "# my custom config file ..."'';
description = '' description = ''
Override the configuration file used by Apache. By default, Override the configuration file used by Apache. By default,
NixOS generates one automatically. NixOS generates one automatically.

View File

@ -34,6 +34,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.nginx; default = pkgs.nginx;
defaultText = "pkgs.nginx";
type = types.package; type = types.package;
description = " description = "
Nginx package to use. Nginx package to use.

View File

@ -36,7 +36,9 @@ in {
}; };
phpPackage = mkOption { phpPackage = mkOption {
type = types.package;
default = pkgs.php; default = pkgs.php;
defaultText = "pkgs.php";
description = '' description = ''
The PHP package to use for running the FPM service. The PHP package to use for running the FPM service.
''; '';

View File

@ -24,6 +24,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.tomcat7; default = pkgs.tomcat7;
defaultText = "pkgs.tomcat7";
example = lib.literalExample "pkgs.tomcat8"; example = lib.literalExample "pkgs.tomcat8";
description = '' description = ''
Which tomcat package to use. Which tomcat package to use.
@ -72,7 +73,9 @@ in
}; };
webapps = mkOption { webapps = mkOption {
type = types.listOf types.package;
default = [ tomcat ]; default = [ tomcat ];
defaultText = "[ tomcat ]";
description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat"; description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat";
}; };
@ -87,7 +90,9 @@ in
}; };
jdk = mkOption { jdk = mkOption {
type = types.package;
default = pkgs.jdk; default = pkgs.jdk;
defaultText = "pkgs.jdk";
description = "Which JDK to use."; description = "Which JDK to use.";
}; };

View File

@ -31,6 +31,7 @@ let
javaPackage = mkOption { javaPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.jre; default = pkgs.jre;
defaultText = "pkgs.jre";
description = '' description = ''
Which Java derivation to use for running Winstone. Which Java derivation to use for running Winstone.
''; '';

View File

@ -75,11 +75,12 @@ in
services.zope2.instances = mkOption { services.zope2.instances = mkOption {
default = {}; default = {};
type = types.loaOf types.optionSet; type = types.loaOf types.optionSet;
example = { example = literalExample ''
{
plone01 = { plone01 = {
http_address = "127.0.0.1:8080"; http_address = "127.0.0.1:8080";
extra = extra =
'' '''
<zodb_db main> <zodb_db main>
mount-point / mount-point /
cache-size 30000 cache-size 30000
@ -90,10 +91,10 @@ in
</filestorage> </filestorage>
</blobstorage> </blobstorage>
</zodb_db> </zodb_db>
''';
};
}
''; '';
};
};
description = "zope2 instances to be created automaticaly by the system."; description = "zope2 instances to be created automaticaly by the system.";
options = [ zope2Opts ]; options = [ zope2Opts ];
}; };

View File

@ -62,6 +62,7 @@ in {
}; };
environment.gnome3.packageSet = mkOption { environment.gnome3.packageSet = mkOption {
type = types.nullOr types.package;
default = null; default = null;
example = literalExample "pkgs.gnome3_16"; example = literalExample "pkgs.gnome3_16";
description = "Which GNOME 3 package set to use."; description = "Which GNOME 3 package set to use.";

View File

@ -66,6 +66,7 @@ in
kdeWorkspacePackage = mkOption { kdeWorkspacePackage = mkOption {
internal = true; internal = true;
default = pkgs.kde4.kde_workspace; default = pkgs.kde4.kde_workspace;
defaultText = "pkgs.kde4.kde_workspace";
type = types.package; type = types.package;
description = "Custom kde-workspace, used for NixOS rebranding."; description = "Custom kde-workspace, used for NixOS rebranding.";
}; };

View File

@ -67,8 +67,9 @@ in
theme = { theme = {
package = mkOption { package = mkOption {
type = types.path; type = types.package;
default = pkgs.gnome3.gnome_themes_standard; default = pkgs.gnome3.gnome_themes_standard;
defaultText = "pkgs.gnome3.gnome_themes_standard";
description = '' description = ''
The package path that contains the theme given in the name option. The package path that contains the theme given in the name option.
''; '';
@ -87,8 +88,9 @@ in
iconTheme = { iconTheme = {
package = mkOption { package = mkOption {
type = types.path; type = types.package;
default = pkgs.gnome3.defaultIconTheme; default = pkgs.gnome3.defaultIconTheme;
defaultText = "pkgs.gnome3.defaultIconTheme";
description = '' description = ''
The package path that contains the icon theme given in the name option. The package path that contains the icon theme given in the name option.
''; '';

View File

@ -69,7 +69,7 @@ in
greeter = { greeter = {
package = mkOption { package = mkOption {
type = types.path; type = types.package;
description = '' description = ''
The LightDM greeter to login via. The package should be a directory The LightDM greeter to login via. The package should be a directory
containing a .desktop file matching the name in the 'name' option. containing a .desktop file matching the name in the 'name' option.
@ -86,6 +86,7 @@ in
}; };
background = mkOption { background = mkOption {
type = types.path;
description = '' description = ''
The background image or color to use. The background image or color to use.
''; '';

View File

@ -61,6 +61,10 @@ in
url = "https://github.com/jagajaga/nixos-slim-theme/archive/2.0.tar.gz"; url = "https://github.com/jagajaga/nixos-slim-theme/archive/2.0.tar.gz";
sha256 = "0lldizhigx7bjhxkipii87y432hlf5wdvamnfxrryf9z7zkfypc8"; sha256 = "0lldizhigx7bjhxkipii87y432hlf5wdvamnfxrryf9z7zkfypc8";
}; };
defaultText = ''pkgs.fetchurl {
url = "https://github.com/jagajaga/nixos-slim-theme/archive/2.0.tar.gz";
sha256 = "0lldizhigx7bjhxkipii87y432hlf5wdvamnfxrryf9z7zkfypc8";
}'';
example = literalExample '' example = literalExample ''
pkgs.fetchurl { pkgs.fetchurl {
url = "mirror://sourceforge/slim.berlios/slim-wave.tar.gz"; url = "mirror://sourceforge/slim.berlios/slim-wave.tar.gz";

View File

@ -76,6 +76,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.redshift; default = pkgs.redshift;
defaultText = "pkgs.redshift";
description = '' description = ''
redshift derivation to use. redshift derivation to use.
''; '';

View File

@ -16,6 +16,7 @@ in
services.xserver.windowManager.xmonad = { services.xserver.windowManager.xmonad = {
enable = mkEnableOption "xmonad"; enable = mkEnableOption "xmonad";
haskellPackages = mkOption { haskellPackages = mkOption {
type = lib.types.packageSet;
default = pkgs.haskellPackages; default = pkgs.haskellPackages;
defaultText = "pkgs.haskellPackages"; defaultText = "pkgs.haskellPackages";
example = literalExample "pkgs.haskell.packages.ghc784"; example = literalExample "pkgs.haskell.packages.ghc784";

View File

@ -205,7 +205,7 @@ in
system.replaceRuntimeDependencies = mkOption { system.replaceRuntimeDependencies = mkOption {
default = []; default = [];
example = lib.literalExample "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { ... }; }) ]"; example = lib.literalExample "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { }; }) ]";
type = types.listOf (types.submodule ( type = types.listOf (types.submodule (
{ options, ... }: { { options, ... }: {
options.original = mkOption { options.original = mkOption {

View File

@ -20,6 +20,7 @@ in
options = { options = {
boot.kernelPackages = mkOption { boot.kernelPackages = mkOption {
type = types.packageSet;
default = pkgs.linuxPackages; default = pkgs.linuxPackages;
# We don't want to evaluate all of linuxPackages for the manual # We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly. # - some of it might not even evaluate correctly.
@ -63,7 +64,7 @@ in
}; };
boot.extraModulePackages = mkOption { boot.extraModulePackages = mkOption {
type = types.listOf types.path; type = types.listOf types.package;
default = []; default = [];
example = literalExample "[ pkgs.linuxPackages.nvidia_x11 ]"; example = literalExample "[ pkgs.linuxPackages.nvidia_x11 ]";
description = "A list of additional packages supplying kernel modules."; description = "A list of additional packages supplying kernel modules.";

View File

@ -251,6 +251,7 @@ in
}; };
extraFiles = mkOption { extraFiles = mkOption {
type = types.attrsOf types.path;
default = {}; default = {};
example = literalExample '' example = literalExample ''
{ "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; } { "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; }

View File

@ -39,7 +39,7 @@ in
dhcp dhcp
chain http://boot.ipxe.org/demo/boot.php chain http://boot.ipxe.org/demo/boot.php
'''; ''';
}; }
''; '';
}; };
}; };

View File

@ -229,7 +229,7 @@ in
boot.initrd.luks.devices = mkOption { boot.initrd.luks.devices = mkOption {
default = [ ]; default = [ ];
example = [ { name = "luksroot"; device = "/dev/sda3"; preLVM = true; } ]; example = literalExample ''[ { name = "luksroot"; device = "/dev/sda3"; preLVM = true; } ]'';
description = '' description = ''
The list of devices that should be decrypted using LUKS before trying to mount the The list of devices that should be decrypted using LUKS before trying to mount the
root partition. This works for both LVM-over-LUKS and LUKS-over-LVM setups. root partition. This works for both LVM-over-LUKS and LUKS-over-LVM setups.

View File

@ -374,6 +374,7 @@ in
systemd.package = mkOption { systemd.package = mkOption {
default = pkgs.systemd; default = pkgs.systemd;
defaultText = "pkgs.systemd";
type = types.package; type = types.package;
description = "The systemd package."; description = "The systemd package.";
}; };

View File

@ -355,6 +355,7 @@ in
}; };
networking.nameservers = mkOption { networking.nameservers = mkOption {
type = types.listOf types.str;
default = []; default = [];
example = ["130.161.158.4" "130.161.33.17"]; example = ["130.161.158.4" "130.161.33.17"];
description = '' description = ''
@ -390,6 +391,7 @@ in
}; };
networking.localCommands = mkOption { networking.localCommands = mkOption {
type = types.str;
default = ""; default = "";
example = "text=anything; echo You can put $text here."; example = "text=anything; echo You can put $text here.";
description = '' description = ''

View File

@ -31,6 +31,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.openvswitch; default = pkgs.openvswitch;
defaultText = "pkgs.openvswitch";
description = '' description = ''
Open vSwitch package to use. Open vSwitch package to use.
''; '';