Skip to content

Commit 06d21e8

Browse files
committed
himalaya: add args to manage cargo features
1 parent f645f1c commit 06d21e8

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

  • pkgs/applications/networking/mailreaders/himalaya

pkgs/applications/networking/mailreaders/himalaya/default.nix

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
, Security
1010
, libiconv
1111
, openssl
12+
, notmuch
13+
, withImapBackend ? true
14+
, withNotmuchBackend ? false
15+
, withSmtpSender ? true
1216
}:
1317

1418
rustPlatform.buildRustPackage rec {
@@ -25,28 +29,28 @@ rustPlatform.buildRustPackage rec {
2529
cargoSha256 = "sha256-FXfh6T8dNsnD/V/wYSMDWs+ll0d1jg1Dc3cQT39b0ws=";
2630

2731
nativeBuildInputs = [ ]
28-
++ lib.optionals (installManPages || installShellCompletions) [ installShellFiles ]
29-
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
30-
31-
buildInputs =
32-
if stdenv.hostPlatform.isDarwin then [
33-
Security
34-
libiconv
35-
] else [
36-
openssl
37-
];
38-
39-
# TODO: remove this flag once this issue is fixed:
32+
++ lib.optional (installManPages || installShellCompletions) installShellFiles
33+
++ lib.optional (!stdenv.hostPlatform.isDarwin) pkg-config;
34+
35+
buildInputs = [ ]
36+
++ (if stdenv.hostPlatform.isDarwin then [ Security libiconv ] else [ openssl ])
37+
++ lib.optional withNotmuchBackend notmuch;
38+
39+
buildNoDefaultFeatures = true;
40+
buildFeatures = [ ]
41+
++ lib.optional withImapBackend "imap-backend"
42+
++ lib.optional withNotmuchBackend "notmuch-backend"
43+
++ lib.optional withSmtpSender "smtp-sender";
44+
45+
# TODO: remove me once this issue is fixed:
4046
# https://todo.sr.ht/~soywod/pimalaya/36
4147
cargoTestFlags = [ "--lib" ];
4248

4349
postInstall = lib.optionalString installManPages ''
44-
# Install man pages
4550
mkdir -p $out/man
4651
$out/bin/himalaya man $out/man
4752
installManPage $out/man/*
4853
'' + lib.optionalString installShellCompletions ''
49-
# Install shell completions
5054
installShellCompletion --cmd himalaya \
5155
--bash <($out/bin/himalaya completion bash) \
5256
--fish <($out/bin/himalaya completion fish) \

0 commit comments

Comments
 (0)