Skip to content

Commit

Permalink
Add missing 'type', 'defaultText' and 'literalExample' in module defi…
Browse files Browse the repository at this point in the history
…nitions

- add missing types in module definitions
- add missing 'defaultText' in module definitions
- wrap example with 'literalExample' where necessary in module definitions
  • Loading branch information
Thomas Strobel committed Jan 17, 2016
1 parent ae5ef2b commit a04a727
Show file tree
Hide file tree
Showing 81 changed files with 175 additions and 97 deletions.
1 change: 1 addition & 0 deletions nixos/modules/config/ldap.nix
Expand Up @@ -57,6 +57,7 @@ in
users.ldap = {

enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable authentication against an LDAP server.";
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/config/pulseaudio.nix
Expand Up @@ -99,6 +99,7 @@ in {
package = mkOption {
type = types.package;
default = pulseaudioLight;
defaultText = "pkgs.pulseaudioLight";
example = literalExample "pkgs.pulseaudioFull";
description = ''
The PulseAudio derivation to use. This can be used to enable
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/config/shells-environment.nix
Expand Up @@ -119,6 +119,7 @@ in

environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh";
defaultText = "\${config.system.build.binsh}/bin/sh";
example = literalExample ''
"''${pkgs.dash}/bin/dash"
'';
Expand Down
5 changes: 3 additions & 2 deletions nixos/modules/config/unix-odbc-drivers.nix
Expand Up @@ -10,8 +10,9 @@ with lib;

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

environment.etc."odbcinst.ini".text =
let inis = config.environment.unixODBCDrivers;
let inis = map (x : x.ini) config.environment.unixODBCDrivers;
in lib.concatStringsSep "\n" inis;

};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/misc/crashdump.nix
Expand Up @@ -24,6 +24,7 @@ in
'';
};
kernelPackages = mkOption {
type = types.package;
default = pkgs.linuxPackages;
# We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly.
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/misc/nixos.nix
Expand Up @@ -37,8 +37,8 @@ with lib;

nixos.extraModules = mkOption {
default = [];
example = literalExample "mkIf config.services.openssh.enable [ ./sshd-config.nix ]";
type = types.listOf types.unspecified;
example = literalExample "[ ./sshd-config.nix ]";
type = types.listOf (types.either (types.submodule ({...}:{options={};})) types.path);
description = ''
Define additional modules which would be loaded to evaluate the
configuration.
Expand Down
24 changes: 14 additions & 10 deletions nixos/modules/programs/ssh.nix
Expand Up @@ -93,7 +93,9 @@ in
};

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

};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/audio/liquidsoap.nix
Expand Up @@ -46,7 +46,7 @@ in
example = {
myStream1 = literalExample "\"/etc/liquidsoap/myStream1.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);
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/backup/bacula.nix
Expand Up @@ -207,7 +207,7 @@ in {
description = ''
Extra configuration to be passed in Client directive.
'';
example = literalExample ''
example = ''
Maximum Concurrent Jobs = 20;
Heartbeat Interval = 30;
'';
Expand All @@ -218,7 +218,7 @@ in {
description = ''
Extra configuration to be passed in Messages directive.
'';
example = literalExample ''
example = ''
console = all
'';
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/backup/rsnapshot.nix
Expand Up @@ -43,6 +43,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.rsnapshot;
defaultText = "pkgs.rsnapshot";
example = literalExample "pkgs.rsnapshotGit";
description = ''
RSnapshot package to use.
Expand Down
Expand Up @@ -80,6 +80,7 @@ in {

packages = mkOption {
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;
description = ''
Packages to add to PATH for the jenkins process.
Expand Down
Expand Up @@ -74,7 +74,7 @@ in {
];
};
}
];
]
'';
description = ''
Job descriptions for Jenkins Job Builder in Nix format.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/couchdb.nix
Expand Up @@ -38,6 +38,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.couchdb;
defaultText = "pkgs.couchdb";
example = literalExample "pkgs.couchdb";
description = ''
CouchDB package to use.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/firebird.nix
Expand Up @@ -49,6 +49,7 @@ in

package = mkOption {
default = pkgs.firebirdSuper;
defaultText = "pkgs.firebirdSuper";
type = types.package;
/*
Example: <code>package = pkgs.firebirdSuper.override { icu =
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/hbase.nix
Expand Up @@ -44,6 +44,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.hbase;
defaultText = "pkgs.hbase";
example = literalExample "pkgs.hbase";
description = ''
HBase package to use.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/influxdb.nix
Expand Up @@ -120,6 +120,7 @@ in

package = mkOption {
default = pkgs.influxdb;
defaultText = "pkgs.influxdb";
description = "Which influxdb derivation to use";
type = types.package;
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/mongodb.nix
Expand Up @@ -41,6 +41,7 @@ in

package = mkOption {
default = pkgs.mongodb;
defaultText = "pkgs.mongodb";
type = types.package;
description = "
Which MongoDB derivation to use.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/neo4j.nix
Expand Up @@ -49,6 +49,7 @@ in {
package = mkOption {
description = "Neo4j package to use.";
default = pkgs.neo4j;
defaultText = "pkgs.neo4j";
type = types.package;
};

Expand Down
30 changes: 14 additions & 16 deletions nixos/modules/services/databases/openldap.nix
Expand Up @@ -25,22 +25,7 @@ in
description = "
Whether to enable the ldap server.
";
example = literalExample ''
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
''';
'';
example = true;
};

user = mkOption {
Expand All @@ -67,6 +52,19 @@ in
description = "
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
'';
};
};

Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/opentsdb.nix
Expand Up @@ -26,6 +26,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.opentsdb;
defaultText = "pkgs.opentsdb";
example = literalExample "pkgs.opentsdb";
description = ''
OpenTSDB package to use.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/databases/redis.nix
Expand Up @@ -46,6 +46,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.redis;
defaultText = "pkgs.redis";
description = "Which Redis derivation to use.";
};

Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/hardware/freefall.nix
Expand Up @@ -21,6 +21,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.freefall;
defaultText = "pkgs.freefall";
description = ''
freefall derivation to use.
'';
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/hardware/upower.nix
Expand Up @@ -27,6 +27,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.upower;
defaultText = "pkgs.upower";
example = lib.literalExample "pkgs.upower";
description = ''
Which upower package to use.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/logging/logrotate.nix
Expand Up @@ -13,6 +13,7 @@ in
options = {
services.logrotate = {
enable = mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable the logrotate cron job
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/services/logging/logstash.nix
Expand Up @@ -33,6 +33,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.logstash;
defaultText = "pkgs.logstash";
example = literalExample "pkgs.logstash";
description = "Logstash package to use.";
};
Expand Down Expand Up @@ -84,7 +85,7 @@ in
type = types.lines;
default = ''stdin { type => "example" }'';
description = "Logstash input configuration.";
example = literalExample ''
example = ''
# Read from journal
pipe {
command => "''${pkgs.systemd}/bin/journalctl -f -o json"
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/logging/syslog-ng.nix
Expand Up @@ -39,6 +39,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.syslogng;
defaultText = "pkgs.syslogng";
description = ''
The package providing syslog-ng binaries.
'';
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/services/mail/dovecot.nix
Expand Up @@ -90,6 +90,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.dovecot22;
defaultText = "pkgs.dovecot22";
description = "Dovecot package to use.";
};

Expand Down Expand Up @@ -131,7 +132,7 @@ in
modules = mkOption {
type = types.listOf types.package;
default = [];
example = [ pkgs.dovecot_pigeonhole ];
example = literalExample "[ pkgs.dovecot_pigeonhole ]";
description = ''
Symlinks the contents of lib/dovecot of every given package into
/var/lib/dovecot/modules. This will make the given modules available
Expand Down
3 changes: 1 addition & 2 deletions nixos/modules/services/misc/apache-kafka.nix
Expand Up @@ -118,9 +118,8 @@ in {

package = mkOption {
description = "The kafka package to use";

default = pkgs.apacheKafka;

defaultText = "pkgs.apacheKafka";
type = types.package;
};

Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/services/misc/autofs.nix
Expand Up @@ -27,8 +27,9 @@ in
};

autoMaster = mkOption {
type = types.str;
example = literalExample ''
autoMaster = let
let
mapConf = pkgs.writeText "auto" '''
kernel -ro,soft,intr ftp.kernel.org:/pub/linux
boot -fstype=ext2 :/dev/hda1
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/misc/cgminer.nix
Expand Up @@ -41,6 +41,7 @@ in

package = mkOption {
default = pkgs.cgminer;
defaultText = "pkgs.cgminer";
description = "Which cgminer derivation to use.";
type = types.package;
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/misc/confd.nix
Expand Up @@ -64,6 +64,7 @@ in {
package = mkOption {
description = "Confd package to use.";
default = pkgs.confd;
defaultText = "pkgs.confd";
type = types.package;
};
};
Expand Down
10 changes: 5 additions & 5 deletions nixos/modules/services/misc/etcd.nix
Expand Up @@ -77,11 +77,11 @@ in {
default = {};
example = literalExample ''
{
"CORS": "*",
"NAME": "default-name",
"MAX_RESULT_BUFFER": "1024",
"MAX_CLUSTER_SIZE": "9",
"MAX_RETRY_ATTEMPTS": "3"
"CORS" = "*";
"NAME" = "default-name";
"MAX_RESULT_BUFFER" = "1024";
"MAX_CLUSTER_SIZE" = "9";
"MAX_RETRY_ATTEMPTS" = "3";
}
'';
};
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/services/misc/felix.nix
Expand Up @@ -23,7 +23,9 @@ in
};

bundles = mkOption {
type = types.listOf types.package;
default = [ pkgs.felix_remoteshell ];
defaultText = "[ pkgs.felix_remoteshell ]";
description = "List of bundles that should be activated on startup";
};

Expand Down

0 comments on commit a04a727

Please sign in to comment.