summary refs log tree commit diff
path: root/pkgs/tools/system/logrotate/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/logrotate/default.nix')
-rw-r--r--pkgs/tools/system/logrotate/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/tools/system/logrotate/default.nix b/pkgs/tools/system/logrotate/default.nix
index 75e25bcc673..75f60968440 100644
--- a/pkgs/tools/system/logrotate/default.nix
+++ b/pkgs/tools/system/logrotate/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchFromGitHub, mailutils, gzip, popt, autoreconfHook }:
+{ stdenv, fetchFromGitHub, gzip, popt, autoreconfHook
+, mailutils ? null
+}:
 
 stdenv.mkDerivation rec {
   name = "logrotate-${version}";
@@ -14,8 +16,11 @@ stdenv.mkDerivation rec {
   # Logrotate wants to access the 'mail' program; to be done.
   patchPhase = ''
     sed -i -e 's,[a-z/]\+gzip,${gzip}/bin/gzip,' \
-           -e 's,[a-z/]\+gunzip,${gzip}/bin/gunzip,' \
-           -e 's,[a-z/]\+mail,${mailutils}/bin/mail,' configure.ac
+           -e 's,[a-z/]\+gunzip,${gzip}/bin/gunzip,' configure.ac
+
+    ${stdenv.lib.optionalString (mailutils != null) ''
+    sed -i -e 's,[a-z/]\+mail,${mailutils}/bin/mail,' configure.ac
+    ''}
   '';
 
   autoreconfPhase = ''