diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index c6c5f8436902..d2fc9cf0d26f 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -1,18 +1,5 @@ -{ stdenv, writeScript -, fetchurl, groff -}: +{ stdenv, writeScript, fetchurl, groff, system-sendmail }: -let - sendmail-script = writeScript "sendmail-script" '' - #!/bin/sh - - if [ -x /run/wrappers/bin/sendmail ]; then - /run/wrappers/bin/sendmail "$@" - else - /run/current-system/sw/bin/sendmail "$@" - fi - ''; -in stdenv.mkDerivation rec { name = "mdadm-4.1"; @@ -23,7 +10,7 @@ stdenv.mkDerivation rec { # This is to avoid self-references, which causes the initrd to explode # in size and in turn prevents mdraid systems from booting. - allowedReferences = [ stdenv.cc.libc.out sendmail-script ]; + allowedReferences = [ stdenv.cc.libc.out system-sendmail ]; patches = [ ./no-self-references.patch ]; @@ -40,7 +27,7 @@ stdenv.mkDerivation rec { preConfigure = '' sed -e 's@/lib/udev@''${out}/lib/udev@' \ -e 's@ -Werror @ @' \ - -e 's@/usr/sbin/sendmail@${sendmail-script}@' -i Makefile + -e 's@/usr/sbin/sendmail@${system-sendmail}@' -i Makefile ''; meta = with stdenv.lib; {