anchor.diff:          '';
         };
   
  +      cookie = mkOption {
  +        default = "";
  +        type = types.str;
  +        description = ''
  +          Erlang cookie is a string of arbitrary length which must
  +          be the same for several nodes to be allowed to communicate.
  +          Leave empty to generate automatically.
  +        '';
  +      };
  +
  +      config = mkOption {
  +        default = "";
  +        type = types.str;
  +        description = ''
  +          Verbatim configuration file contents.
  +          See http://www.rabbitmq.com/configure.htm
  +        '';
  +      };
  +
  +      plugins = mkOption {
  +        default = [];
  +        type = types.listOf types.str;
  +        description = "The names of plugins to enable";
  +      };
       };
     };
   
  
positive.code:         '';
        };
  
  
        dataDir = mkOption {
          type = types.path;
          default = "/var/lib/rabbitmq";
  
negative.code:       preStart = ''
          mkdir -p ${cfg.dataDir} && chmod 0700 ${cfg.dataDir}
          if [ "$(id -u)" = 0 ]; then chown rabbitmq:rabbitmq ${cfg.dataDir}; fi
          
          ${optionalString (cfg.cookie != "") ''
              echo -n ${cfg.cookie} > ${cfg.dataDir}/.erlang.cookie
              chmod 400 ${cfg.dataDir}/.erlang.cookie
              chown rabbitmq:rabbitmq ${cfg.dataDir}/.erlang.cookie
          ''}
  
          mkdir -p /var/log/rabbitmq && chmod 0700 /var/log/rabbitmq
          chown rabbitmq:rabbitmq /var/log/rabbitmq
        '';
      };
  
  