31 runtimePath = lib.makeBinPath (
34 getconf # for getting memory limits
38 coreutils # used by helper scripts
40 ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]
41 ); # for systemd unit activation check
44 stdenv.mkDerivation rec {
45 pname = "rabbitmq-server";
48 # when updating, consider bumping elixir version in all-packages.nix
50 url = "https://github.com/rabbitmq/rabbitmq-server/releases/download/v${version}/${pname}-${version}.tar.xz";
51 hash = "sha256-mSwjQTLkEWBBbbMDLZ+qldS2YDcUvp8BB+J0+RLQvZE=";
73 ++ lib.optionals stdenv.hostPlatform.isDarwin [
86 "PREFIX=${placeholder "out"}"
87 "RMQ_ERLAPP_DIR=${placeholder "out"}"
96 export LANG=C.UTF-8 # fix elixir locale warning
100 # rabbitmq-env calls to sed/coreutils, so provide everything early
101 sed -i $out/sbin/rabbitmq-env -e '2s|^|PATH=${runtimePath}\''${PATH:+:}\$PATH/\n|'
103 # We know exactly where rabbitmq is gonna be, so we patch that into the env-script.
104 # By doing it early we make sure that auto-detection for this will
105 # never be executed (somewhere below in the script).
106 sed -i $out/sbin/rabbitmq-env -e "2s|^|RABBITMQ_SCRIPTS_DIR=$out/sbin\n|"
108 # there’s a few stray files that belong into share
109 mkdir -p $doc/share/doc/rabbitmq-server
110 mv $out/LICENSE* $doc/share/doc/rabbitmq-server
112 # and an unecessarily copied INSTALL file
117 vm-test = nixosTests.rabbitmq;
121 homepage = "https://www.rabbitmq.com/";
122 description = "Implementation of the AMQP messaging protocol";
123 changelog = "https://github.com/rabbitmq/rabbitmq-server/releases/tag/v${version}";
124 license = lib.licenses.mpl20;
125 platforms = lib.platforms.unix;
126 maintainers = with lib.maintainers; [ samueltardieu ];