summary refs log tree commit diff
path: root/nixos/modules/services/amqp
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2021-08-30 17:11:49 +0900
committerRaphael Megzari <raphael@megzari.com>2021-08-30 18:43:09 +0900
commitf091420c1d194ad398142959266f18493da1ff83 (patch)
tree3e6ca32cd1cb5a9487f364079faceb3b7617c1b5 /nixos/modules/services/amqp
parent36cf478468c707fa2e867227ce04b1a729fdf6f7 (diff)
downloadnixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar.gz
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar.bz2
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar.lz
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar.xz
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.tar.zst
nixpkgs-f091420c1d194ad398142959266f18493da1ff83.zip
rabbitmq: add option to enable management plugin
Diffstat (limited to 'nixos/modules/services/amqp')
-rw-r--r--nixos/modules/services/amqp/rabbitmq.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/services/amqp/rabbitmq.nix b/nixos/modules/services/amqp/rabbitmq.nix
index 2db28210262..8fdfda9a66d 100644
--- a/nixos/modules/services/amqp/rabbitmq.nix
+++ b/nixos/modules/services/amqp/rabbitmq.nix
@@ -134,6 +134,28 @@ in
         type = types.listOf types.path;
         description = "The list of directories containing external plugins";
       };
+
+      managementPlugin = mkOption {
+        description = "The options to run the management plugin";
+        type = types.submodule {
+          options = {
+            enable = mkOption {
+              default = false;
+              type = types.bool;
+              description = ''
+                Whether to enable the management plugin
+              '';
+            };
+            port = mkOption {
+              default = 15672;
+              type = types.port;
+              description = ''
+                On which port to run the management plugin
+              '';
+            };
+          };
+        };
+      };
     };
   };
 
@@ -158,8 +180,13 @@ in
 
     services.rabbitmq.configItems = {
       "listeners.tcp.1" = mkDefault "${cfg.listenAddress}:${toString cfg.port}";
+    } // optionalAttrs cfg.managementPlugin.enable {
+      "management.tcp.port" = toString cfg.managementPlugin.port;
+      "management.tcp.ip" = cfg.listenAddress;
     };
 
+    services.rabbitmq.plugins = optional cfg.managementPlugin.enable "rabbitmq_management";
+
     systemd.services.rabbitmq = {
       description = "RabbitMQ Server";