Script for setting up rabbitmq locally
This commit is contained in:
parent
c9a7d79bcf
commit
9f3196cd1f
14
rabbitmq.nix
14
rabbitmq.nix
@ -1,11 +1,25 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cookie = "dontusethisinprod";
|
||||||
|
setup = pkgs.writeScriptBin "setup-rabbitmq.sh" ''
|
||||||
|
rabbitmqctl --erlang-cookie "${cookie}" add_user admin_user password
|
||||||
|
rabbitmqctl --erlang-cookie "${cookie}" set_user_tags admin_user administrator
|
||||||
|
rabbitmqctl --erlang-cookie "${cookie}" set_permissions -p / admin_user ".*" ".*" ".*"
|
||||||
|
|
||||||
|
rabbitmqctl --erlang-cookie "${cookie}" add_user reddit_user password
|
||||||
|
rabbitmqctl --erlang-cookie "${cookie}" set_permissions -p / reddit_user ".*" ".*" ".*"
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.rabbitmq = {
|
services.rabbitmq = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "0.0.0.0";
|
listenAddress = "0.0.0.0";
|
||||||
managementPlugin.enable = true;
|
managementPlugin.enable = true;
|
||||||
|
cookie = "dontusethisinprod";
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ 5672 15672 ];
|
networking.firewall.allowedTCPPorts = [ 5672 15672 ];
|
||||||
|
|
||||||
|
environment.systemPackages = [ setup ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user