about summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders
diff options
context:
space:
mode:
authorClément DOUIN <clement.douin@posteo.net>2023-02-16 14:45:49 +0100
committerClément DOUIN <clement.douin@posteo.net>2023-02-16 14:46:07 +0100
commit06d21e8659ddb58ee1bcde88610ad7f3a2a7e2f4 (patch)
treeceb3143411f31515f0f2d11890468c801b5dc765 /pkgs/applications/networking/mailreaders
parentf645f1ce98ac0ebdb63b1efd194dee21393f00a7 (diff)
himalaya: add args to manage cargo features
Diffstat (limited to 'pkgs/applications/networking/mailreaders')
-rw-r--r--pkgs/applications/networking/mailreaders/himalaya/default.nix32
1 files changed, 18 insertions, 14 deletions
diff --git a/pkgs/applications/networking/mailreaders/himalaya/default.nix b/pkgs/applications/networking/mailreaders/himalaya/default.nix
index cd82c8e1f9613..fc31c5efd4875 100644
--- a/pkgs/applications/networking/mailreaders/himalaya/default.nix
+++ b/pkgs/applications/networking/mailreaders/himalaya/default.nix
@@ -9,6 +9,10 @@
 , Security
 , libiconv
 , openssl
+, notmuch
+, withImapBackend ? true
+, withNotmuchBackend ? false
+, withSmtpSender ? true
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -25,28 +29,28 @@ rustPlatform.buildRustPackage rec {
   cargoSha256 = "sha256-FXfh6T8dNsnD/V/wYSMDWs+ll0d1jg1Dc3cQT39b0ws=";
 
   nativeBuildInputs = [ ]
-    ++ lib.optionals (installManPages || installShellCompletions) [ installShellFiles ]
-    ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
-
-  buildInputs =
-    if stdenv.hostPlatform.isDarwin then [
-      Security
-      libiconv
-    ] else [
-      openssl
-    ];
-
-  # TODO: remove this flag once this issue is fixed:
+    ++ lib.optional (installManPages || installShellCompletions) installShellFiles
+    ++ lib.optional (!stdenv.hostPlatform.isDarwin) pkg-config;
+
+  buildInputs = [ ]
+    ++ (if stdenv.hostPlatform.isDarwin then [ Security libiconv ] else [ openssl ])
+    ++ lib.optional withNotmuchBackend notmuch;
+
+  buildNoDefaultFeatures = true;
+  buildFeatures = [ ]
+    ++ lib.optional withImapBackend "imap-backend"
+    ++ lib.optional withNotmuchBackend "notmuch-backend"
+    ++ lib.optional withSmtpSender "smtp-sender";
+
+  # TODO: remove me once this issue is fixed:
   # https://todo.sr.ht/~soywod/pimalaya/36
   cargoTestFlags = [ "--lib" ];
 
   postInstall = lib.optionalString installManPages ''
-    # Install man pages
     mkdir -p $out/man
     $out/bin/himalaya man $out/man
     installManPage $out/man/*
   '' + lib.optionalString installShellCompletions ''
-    # Install shell completions
     installShellCompletion --cmd himalaya \
       --bash <($out/bin/himalaya completion bash) \
       --fish <($out/bin/himalaya completion fish) \