aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix
new file mode 100644
index 000000000000..ee5ea9d7e030
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/networking/msmtp/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig, texinfo
+, netcat-gnu, gnutls, gsasl, libidn2, Security
+, withKeyring ? true, libsecret ? null
+, systemd ? null }:
+
+let
+ tester = "n"; # {x| |p|P|n|s}
+ journal = if stdenv.isLinux then "y" else "n";
+
+in stdenv.mkDerivation rec {
+ pname = "msmtp";
+ version = "1.8.12";
+
+ src = fetchurl {
+ url = "https://marlam.de/${pname}/releases/${pname}-${version}.tar.xz";
+ sha256 = "0m33m5bc7ajmgy7vivnzj3mhybg37259hx79xypj769kfyafyvx8";
+ };
+
+ patches = [
+ ./paths.patch
+ ];
+
+ buildInputs = [ gnutls gsasl libidn2 ]
+ ++ stdenv.lib.optional stdenv.isDarwin Security
+ ++ stdenv.lib.optional withKeyring libsecret;
+
+ nativeBuildInputs = [ autoreconfHook pkgconfig texinfo ];
+
+ configureFlags =
+ [ "--sysconfdir=/etc" ] ++ stdenv.lib.optional stdenv.isDarwin [ "--with-macosx-keyring" ];
+
+ postInstall = ''
+ install -d $out/share/doc/${pname}/scripts
+ cp -r scripts/{find_alias,msmtpqueue,msmtpq,set_sendmail} $out/share/doc/${pname}/scripts
+ install -Dm644 doc/*.example $out/share/doc/${pname}
+
+ substitute scripts/msmtpq/msmtpq $out/bin/msmtpq \
+ --replace @msmtp@ $out/bin/msmtp \
+ --replace @nc@ ${netcat-gnu}/bin/nc \
+ --replace @journal@ ${journal} \
+ ${lib.optionalString (journal == "y") "--replace @systemdcat@ ${systemd}/bin/systemd-cat" } \
+ --replace @test@ ${tester}
+
+ substitute scripts/msmtpq/msmtp-queue $out/bin/msmtp-queue \
+ --replace @msmtpq@ $out/bin/msmtpq
+
+ ln -s msmtp $out/bin/sendmail
+
+ chmod +x $out/bin/*
+ '';
+
+ meta = with stdenv.lib; {
+ description = "Simple and easy to use SMTP client with excellent sendmail compatibility";
+ homepage = "https://marlam.de/msmtp/";
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ peterhoeg ];
+ platforms = platforms.unix;
+ };
+}