about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2017-05-13 07:13:07 +0100
committerGitHub <noreply@github.com>2017-05-13 07:13:07 +0100
commitae12ded6bf9685124b55fdbcdc92eb04de1fa553 (patch)
tree49bda536bbe2b8e8a11ead4380593e89f2440e03 /pkgs
parent53a8634ad57c0ef7a81de73921f2a6c7d5c403f8 (diff)
parent4338f096f59ad448192d692504a08565775e06ab (diff)
downloadnixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar.gz
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar.bz2
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar.lz
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar.xz
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.tar.zst
nixlib-ae12ded6bf9685124b55fdbcdc92eb04de1fa553.zip
Merge pull request #25381 from sargon/nullmailer
nullmailer + service: init at 2.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/servers/mail/nullmailer/default.nix51
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/servers/mail/nullmailer/default.nix b/pkgs/servers/mail/nullmailer/default.nix
new file mode 100644
index 000000000000..44840c91b058
--- /dev/null
+++ b/pkgs/servers/mail/nullmailer/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, lib, tls ? true, gnutls ? null }:
+
+assert tls -> gnutls != null;
+
+stdenv.mkDerivation rec {
+
+  version = "2.0";
+  name = "nullmailer-${version}";
+
+  src = fetchurl {
+    url = "http://untroubled.org/nullmailer/nullmailer-${version}.tar.gz";
+    sha256 = "112ghdln8q9yljc8kp9mc3843mh0fyb4rig2v4q2dzy1l324q3yp";
+  };
+
+  buildInputs = stdenv.lib.optional tls gnutls;
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+  ] ++ stdenv.lib.optional tls "--enable-tls";
+
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  # We have to remove the ''var'' directory, since nix can't handle named pipes
+  # and we can't use it in the store anyway. Same for ''etc''.
+  # The second line is need, because the installer of nullmailer will copy its
+  # own prepared version of ''etc'' and ''var'' and also uses the prefix path (configure phase)
+  # for hardcoded absolute references to its own binary farm, e.g. sendmail binary is
+  # calling nullmailer-inject binary. Since we can't configure inside the store of
+  # the derivation we need both directories in the root, but don't want to put them there
+  # during install, hence we have to fix mumbling inside the install directory.
+  # This is kind of a hack, but the only way I know of, yet.
+  postInstall = ''
+    rm -rf $out/var/ $out/etc/
+    mv $out/$out/* $out/
+    rmdir $out/$out
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://untroubled.org/nullmailer/";
+    description = ''
+      A sendmail/qmail/etc replacement MTA for hosts which relay to a fixed set of smart relays.
+      It is designed to be simple to configure, secure, and easily extendable.
+    '';
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers ; [ sargon ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index fdec62a06f3d..c508f7f6ef20 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12747,6 +12747,8 @@ with pkgs;
   inherit (callPackages ../data/fonts/noto-fonts {})
     noto-fonts noto-fonts-cjk noto-fonts-emoji;
 
+  nullmailer = callPackage ../servers/mail/nullmailer { };
+
   numix-icon-theme = callPackage ../data/icons/numix-icon-theme { };
 
   numix-icon-theme-circle = callPackage ../data/icons/numix-icon-theme-circle { };