rabbitmq: nixpkgs-fmt

wip/nixpkgs-raku
happysalada 3 years ago committed by Raphael Megzari
parent 87e5bc2cc2
commit 36cf478468
  1. 13
      nixos/modules/services/amqp/rabbitmq.nix

@ -7,12 +7,13 @@ let
inherit (builtins) concatStringsSep; inherit (builtins) concatStringsSep;
config_file_content = lib.generators.toKeyValue {} cfg.configItems; config_file_content = lib.generators.toKeyValue { } cfg.configItems;
config_file = pkgs.writeText "rabbitmq.conf" config_file_content; config_file = pkgs.writeText "rabbitmq.conf" config_file_content;
advanced_config_file = pkgs.writeText "advanced.config" cfg.config; advanced_config_file = pkgs.writeText "advanced.config" cfg.config;
in { in
{
###### interface ###### interface
options = { options = {
services.rabbitmq = { services.rabbitmq = {
@ -79,7 +80,7 @@ in {
}; };
configItems = mkOption { configItems = mkOption {
default = {}; default = { };
type = types.attrsOf types.str; type = types.attrsOf types.str;
example = literalExample '' example = literalExample ''
{ {
@ -123,13 +124,13 @@ in {
}; };
plugins = mkOption { plugins = mkOption {
default = []; default = [ ];
type = types.listOf types.str; type = types.listOf types.str;
description = "The names of plugins to enable"; description = "The names of plugins to enable";
}; };
pluginDirs = mkOption { pluginDirs = mkOption {
default = []; default = [ ];
type = types.listOf types.path; type = types.listOf types.path;
description = "The list of directories containing external plugins"; description = "The list of directories containing external plugins";
}; };
@ -180,7 +181,7 @@ in {
RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" '' RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" ''
[ ${concatStringsSep "," cfg.plugins} ]. [ ${concatStringsSep "," cfg.plugins} ].
''; '';
} // optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; }; } // optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; };
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/sbin/rabbitmq-server"; ExecStart = "${cfg.package}/sbin/rabbitmq-server";

Loading…
Cancel
Save