Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e0ae8476fb24
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ed16f830b0ce
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 19, 2020

  1. rabbitmq: make all dependencies explicit

    Some things were provided by default, some by systemd unit and some
    were just miraculously working. This turns them into explicit
    dependencies of the package itself, making everything properly
    overrideable.
    
    + providing glibcLocales fixes elixir compile warnings
    
    + providing systemd dependency allows rabbit to use systemctl for unit
      activation check instead of falling back to sleep. This was seen as
      a warning during startup.
    binarin authored and Profpatsch committed Jan 19, 2020
    Copy the full SHA
    ed16f83 View commit details
Showing with 29 additions and 9 deletions.
  1. +4 −1 nixos/modules/services/amqp/rabbitmq.nix
  2. +25 −8 pkgs/servers/amqp/rabbitmq-server/default.nix
5 changes: 4 additions & 1 deletion nixos/modules/services/amqp/rabbitmq.nix
Original file line number Diff line number Diff line change
@@ -165,7 +165,10 @@ in {
after = [ "network.target" "epmd.socket" ];
wants = [ "network.target" "epmd.socket" ];

path = [ cfg.package pkgs.procps ];
path = [
cfg.package
pkgs.coreutils # mkdir/chown/chmod for preStart
];

environment = {
RABBITMQ_MNESIA_BASE = "${cfg.dataDir}/mnesia";
33 changes: 25 additions & 8 deletions pkgs/servers/amqp/rabbitmq-server/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv, fetchurl, erlang, elixir, python, libxml2, libxslt, xmlto
, docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync, getconf, socat
, procps, coreutils, gnused, systemd, glibcLocales
, AppKit, Carbon, Cocoa
}:

@@ -15,23 +16,39 @@ stdenv.mkDerivation rec {
};

buildInputs =
[ erlang elixir python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip rsync ]
[ erlang elixir python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip rsync glibcLocales ]
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];

outputs = [ "out" "man" "doc" ];

installFlags = [ "PREFIX=$(out)" "RMQ_ERLAPP_DIR=$(out)" ];
installTargets = [ "install" "install-man" ];

runtimePath = stdenv.lib.makeBinPath [getconf erlang socat];
preBuild = ''
export LANG=C.UTF-8 # fix elixir locale warning
'';

runtimePath = stdenv.lib.makeBinPath [
erlang
getconf # for getting memory limits
socat systemd procps # for systemd unit activation check
gnused coreutils # used by helper scripts
];
postInstall = ''
echo 'PATH=${runtimePath}:''${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env
# rabbitmq-env calls to sed/coreutils, so provide everything early
sed -i $out/sbin/rabbitmq-env -e '2s|^|PATH=${runtimePath}\''${PATH:+:}\$PATH/\n|'
# rabbitmq-server script uses `dirname` to get hold of a
# rabbitmq-env, so let's provide this file directly. After that
# point everything is OK - the PATH above will kick in
substituteInPlace $out/sbin/rabbitmq-server \
--replace '`dirname $0`/rabbitmq-env' \
"$out/sbin/rabbitmq-env"
# we know exactly where rabbitmq is gonna be,
# so we patch that into the env-script
substituteInPlace $out/sbin/rabbitmq-env \
--replace 'RABBITMQ_SCRIPTS_DIR=`dirname $SCRIPT_PATH`' \
"RABBITMQ_SCRIPTS_DIR=$out/sbin"
# We know exactly where rabbitmq is gonna be, so we patch that into the env-script.
# By doing it early we make sure that auto-detection for this will
# never be executed (somewhere below in the script).
sed -i $out/sbin/rabbitmq-env -e "2s|^|RABBITMQ_SCRIPTS_DIR=$out/sbin\n|"
# there’s a few stray files that belong into share
mkdir -p $doc/share/doc/rabbitmq-server