about summary refs log tree commit diff
path: root/nixos/modules/services/networking/prosody.nix
diff options
context:
space:
mode:
authorSatoshi Shishiku <satoshi.shishiku@tuta.io>2017-03-01 00:57:02 +0000
committerFlorian Jacob <projects+git@florianjacob.de>2017-11-01 13:37:57 +0100
commit1e45a6459eb682116e3d0e75a9468ad9311fd379 (patch)
tree4241ad02469b892b2de127bd1a5f8fa130c4b57b /nixos/modules/services/networking/prosody.nix
parent36995b788e094c7991904ef28243d1e216286409 (diff)
downloadnixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar.gz
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar.bz2
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar.lz
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar.xz
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.tar.zst
nixlib-1e45a6459eb682116e3d0e75a9468ad9311fd379.zip
prosody service: add types
Diffstat (limited to 'nixos/modules/services/networking/prosody.nix')
-rw-r--r--nixos/modules/services/networking/prosody.nix42
1 files changed, 31 insertions, 11 deletions
diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix
index fb9c9dc67f24..8e2970a1b69c 100644
--- a/nixos/modules/services/networking/prosody.nix
+++ b/nixos/modules/services/networking/prosody.nix
@@ -12,13 +12,13 @@ let
 
       # TODO: require attribute
       key = mkOption {
-        type = types.str;
+        type = types.path;
         description = "Path to the key file";
       };
 
       # TODO: require attribute
       cert = mkOption {
-        type = types.str;
+        type = types.path;
         description = "Path to the certificate file";
       };
     };
@@ -27,71 +27,85 @@ let
   moduleOpts = {
 
     roster = mkOption {
+      type = types.bool;
       default = true;
       description = "Allow users to have a roster";
     };
 
     saslauth = mkOption {
+      type = types.bool;
       default = true;
       description = "Authentication for clients and servers. Recommended if you want to log in.";
     };
 
     tls = mkOption {
+      type = types.bool;
       default = true;
       description = "Add support for secure TLS on c2s/s2s connections";
     };
 
     dialback = mkOption {
+      type = types.bool;
       default = true;
       description = "s2s dialback support";
     };
 
     disco = mkOption {
+      type = types.bool;
       default = true;
       description = "Service discovery";
     };
 
     legacyauth = mkOption {
+      type = types.bool;
       default = true;
       description = "Legacy authentication. Only used by some old clients and bots";
     };
 
     version = mkOption {
+      type = types.bool;
       default = true;
       description = "Replies to server version requests";
     };
 
     uptime = mkOption {
+      type = types.bool;
       default = true;
       description = "Report how long server has been running";
     };
 
     time = mkOption {
+      type = types.bool;
       default = true;
       description = "Let others know the time here on this server";
     };
 
     ping = mkOption {
+      type = types.bool;
       default = true;
       description = "Replies to XMPP pings with pongs";
     };
 
     console = mkOption {
+      type = types.bool;
       default = false;
       description = "telnet to port 5582";
     };
 
     bosh = mkOption {
+      type = types.bool;
       default = false;
       description = "Enable BOSH clients, aka 'Jabber over HTTP'";
     };
 
     httpserver = mkOption {
+      type = types.bool;
       default = false;
       description = "Serve static files from a directory over HTTP";
     };
 
     websocket = mkOption {
+      type = types.bool;
       default = false;
       description = "Enable WebSocket support";
     };
@@ -114,18 +128,20 @@ let
       };
 
       enabled = mkOption {
+        type = types.bool;
         default = false;
         description = "Whether to enable the virtual host";
       };
 
       ssl = mkOption {
-        description = "Paths to SSL files";
+        type = types.nullOr (types.submodule sslOpts);
         default = null;
-        options = [ sslOpts ];
+        description = "Paths to SSL files";
       };
 
       extraConfig = mkOption {
-        default = '''';
+        type = types.lines;
+        default = "";
         description = "Additional virtual host specific configuration";
       };
 
@@ -144,11 +160,13 @@ in
     services.prosody = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = "Whether to enable the prosody server";
       };
 
       allowRegistration = mkOption {
+        type = types.bool;
         default = false;
         description = "Allow account creation";
       };
@@ -156,8 +174,9 @@ in
       modules = moduleOpts;
 
       extraModules = mkOption {
-        description = "Enable custom modules";
+        type = types.listOf types.str;
         default = [];
+        description = "Enable custom modules";
       };
 
       virtualHosts = mkOption {
@@ -183,20 +202,21 @@ in
       };
 
       ssl = mkOption {
-        description = "Paths to SSL files";
+        type = types.nullOr (types.submodule sslOpts);
         default = null;
-        options = [ sslOpts ];
+        description = "Paths to SSL files";
       };
 
       admins = mkOption {
-        description = "List of administrators of the current host";
-        example = [ "admin1@example.com" "admin2@example.com" ];
+        type = types.listOf types.str;
         default = [];
+        example = [ "admin1@example.com" "admin2@example.com" ];
+        description = "List of administrators of the current host";
       };
 
       extraConfig = mkOption {
         type = types.lines;
-        default = '''';
+        default = "";
         description = "Additional prosody configuration";
       };