@@ -12,13 +12,13 @@ let
1212
1313 # TODO: require attribute
1414 key = mkOption {
15− type = types.str;
15+ type = types.path;
1616 description = "Path to the key file";
1717 };
1818
1919 # TODO: require attribute
2020 cert = mkOption {
21− type = types.str;
21+ type = types.path;
2222 description = "Path to the certificate file";
2323 };
2424 };
@@ -27,71 +27,85 @@ let
2727 moduleOpts = {
2828
2929 roster = mkOption {
30+ type = types.bool;
3031 default = true;
3132 description = "Allow users to have a roster";
3233 };
3334
3435 saslauth = mkOption {
36+ type = types.bool;
3537 default = true;
3638 description = "Authentication for clients and servers. Recommended if you want to log in.";
3739 };
3840
3941 tls = mkOption {
42+ type = types.bool;
4043 default = true;
4144 description = "Add support for secure TLS on c2s/s2s connections";
4245 };
4346
4447 dialback = mkOption {
48+ type = types.bool;
4549 default = true;
4650 description = "s2s dialback support";
4751 };
4852
4953 disco = mkOption {
54+ type = types.bool;
5055 default = true;
5156 description = "Service discovery";
5257 };
5358
5459 legacyauth = mkOption {
60+ type = types.bool;
5561 default = true;
5662 description = "Legacy authentication. Only used by some old clients and bots";
5763 };
5864
5965 version = mkOption {
66+ type = types.bool;
6067 default = true;
6168 description = "Replies to server version requests";
6269 };
6370
6471 uptime = mkOption {
72+ type = types.bool;
6573 default = true;
6674 description = "Report how long server has been running";
6775 };
6876
6977 time = mkOption {
78+ type = types.bool;
7079 default = true;
7180 description = "Let others know the time here on this server";
7281 };
7382
7483 ping = mkOption {
84+ type = types.bool;
7585 default = true;
7686 description = "Replies to XMPP pings with pongs";
7787 };
7888
7989 console = mkOption {
90+ type = types.bool;
8091 default = false;
8192 description = "telnet to port 5582";
8293 };
8394
8495 bosh = mkOption {
96+ type = types.bool;
8597 default = false;
8698 description = "Enable BOSH clients, aka 'Jabber over HTTP'";
8799 };
88100
89101 httpserver = mkOption {
102+ type = types.bool;
90103 default = false;
91104 description = "Serve static files from a directory over HTTP";
92105 };
93106
94107 websocket = mkOption {
108+ type = types.bool;
95109 default = false;
96110 description = "Enable WebSocket support";
97111 };
@@ -114,18 +128,20 @@ let
114128 };
115129
116130 enabled = mkOption {
131+ type = types.bool;
117132 default = false;
118133 description = "Whether to enable the virtual host";
119134 };
120135
121136 ssl = mkOption {
122− description = "Paths to SSL files";
137+ type = types.nullOr (types.submodule sslOpts);
123138 default = null;
124− options = [ sslOpts ];
139+ description = "Paths to SSL files";
125140 };
126141
127142 extraConfig = mkOption {
128− default = '''';
143+ type = types.lines;
144+ default = "";
129145 description = "Additional virtual host specific configuration";
130146 };
131147
@@ -144,11 +160,13 @@ in
144160 services.prosody = {
145161
146162 enable = mkOption {
163+ type = types.bool;
147164 default = false;
148165 description = "Whether to enable the prosody server";
149166 };
150167
151168 allowRegistration = mkOption {
169+ type = types.bool;
152170 default = false;
153171 description = "Allow account creation";
154172 };
@@ -156,8 +174,9 @@ in
156174 modules = moduleOpts;
157175
158176 extraModules = mkOption {
159− description = "Enable custom modules";
177+ type = types.listOf types.str;
160178 default = [];
179+ description = "Enable custom modules";
161180 };
162181
163182 virtualHosts = mkOption {
@@ -183,20 +202,21 @@ in
183202 };
184203
185204 ssl = mkOption {
186− description = "Paths to SSL files";
205+ type = types.nullOr (types.submodule sslOpts);
187206 default = null;
188− options = [ sslOpts ];
207+ description = "Paths to SSL files";
189208 };
190209
191210 admins = mkOption {
192− description = "List of administrators of the current host";
193− example = [ "admin1@example.com" "admin2@example.com" ];
211+ type = types.listOf types.str;
194212 default = [];
213+ example = [ "admin1@example.com" "admin2@example.com" ];
214+ description = "List of administrators of the current host";
195215 };
196216
197217 extraConfig = mkOption {
198218 type = types.lines;
199− default = '''';
219+ default = "";
200220 description = "Additional prosody configuration";
201221 };
202222