summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorMichal Sojka <michal.sojka@cvut.cz>2023-05-31 09:18:18 +0200
committerMichal Sojka <michal.sojka@cvut.cz>2023-05-31 13:30:55 +0200
commit47eda8e00a28e5b09e7c1819f9a7fce5fee013e3 (patch)
tree3831e6401bab9d20c0abf61654faa4834502abda /pkgs/tools
parent5e871d8aa6f57cc8e0dc087d1c5013f6e212b4ce (diff)
downloadnixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar.gz
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar.bz2
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar.lz
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar.xz
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.tar.zst
nixpkgs-47eda8e00a28e5b09e7c1819f9a7fce5fee013e3.zip
isync: add optional support for XOAUTH2 authentication method
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/networking/isync/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/tools/networking/isync/default.nix b/pkgs/tools/networking/isync/default.nix
index d5af78afb66..ccf32b43843 100644
--- a/pkgs/tools/networking/isync/default.nix
+++ b/pkgs/tools/networking/isync/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchurl, pkg-config, perl
 , openssl, db, cyrus_sasl, zlib
 , Security
+, withCyrusSaslXoauth2 ? true, cyrus-sasl-xoauth2, makeWrapper
 }:
 
 stdenv.mkDerivation rec {
@@ -20,10 +21,16 @@ stdenv.mkDerivation rec {
     ./work-around-unexpected-EOF-error-messages-at-end-of-SSL-connections.patch
   ];
 
-  nativeBuildInputs = [ pkg-config perl ];
+  nativeBuildInputs = [ pkg-config perl ]
+    ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ];
   buildInputs = [ openssl db cyrus_sasl zlib ]
     ++ lib.optionals stdenv.isDarwin [ Security ];
 
+  postInstall = lib.optionalString withCyrusSaslXoauth2 ''
+    wrapProgram "$out/bin/mbsync" \
+        --prefix SASL_PATH : "${lib.makeSearchPath "lib/sasl2" [ cyrus-sasl-xoauth2 ]}"
+  '';
+
   meta = with lib; {
     homepage = "http://isync.sourceforge.net/";
     # https://sourceforge.net/projects/isync/