8 , installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
9 , installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
12 , buildNoDefaultFeatures ? false
16 rustPlatform.buildRustPackage rec {
17 # Learn more about available cargo features at:
18 # - <https://pimalaya.org/himalaya/cli/latest/installation.html#cargo>
19 inherit buildNoDefaultFeatures buildFeatures;
22 version = "1.0.0-beta.4";
24 src = fetchFromGitHub {
28 hash = "sha256-NrWBg0sjaz/uLsNs8/T4MkUgHOUvAWRix1O5usKsw6o=";
31 cargoHash = "sha256-YS8IamapvmdrOPptQh2Ef9Yold0IK1XIeGs0kDIQ5b8=";
33 NIX_LDFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
34 "-F${darwin.apple_sdk.frameworks.AppKit}/Library/Frameworks"
39 nativeBuildInputs = [ pkg-config ]
40 ++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) pkg-config
41 ++ lib.optional (installManPages || installShellCompletions) installShellFiles;
44 ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa Security ])
45 ++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch
46 ++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;
48 postInstall = lib.optionalString installManPages ''
50 $out/bin/himalaya man $out/man
51 installManPage $out/man/*
52 '' + lib.optionalString installShellCompletions ''
53 installShellCompletion --cmd himalaya \
54 --bash <($out/bin/himalaya completion bash) \
55 --fish <($out/bin/himalaya completion fish) \
56 --zsh <($out/bin/himalaya completion zsh)
60 description = "CLI to manage emails";
61 mainProgram = "himalaya";
62 homepage = "https://pimalaya.org/himalaya/cli/latest/";
63 changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md";
64 license = licenses.mit;
65 maintainers = with maintainers; [ soywod toastal yanganto ];