nixpkgs/pkgs/by-name/hi/himalaya/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.1 KiB
Nix
Raw Normal View History

{ lib
, rustPlatform
, fetchFromGitHub
2021-10-25 15:36:50 +00:00
, stdenv
2024-01-01 16:09:44 +00:00
, pkg-config
2024-04-17 08:32:40 +00:00
, darwin
2021-10-25 15:36:50 +00:00
, installShellFiles
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, notmuch
2024-01-01 16:09:44 +00:00
, gpgme
, buildNoDefaultFeatures ? false
, buildFeatures ? []
}:
2021-10-25 15:36:50 +00:00
rustPlatform.buildRustPackage rec {
2024-04-17 08:32:40 +00:00
# Learn more about available cargo features at:
# - <https://pimalaya.org/himalaya/cli/latest/installation.html#cargo>
inherit buildNoDefaultFeatures buildFeatures;
pname = "himalaya";
2024-04-17 08:32:40 +00:00
version = "1.0.0-beta.4";
src = fetchFromGitHub {
owner = "soywod";
repo = pname;
rev = "v${version}";
2024-04-17 08:32:40 +00:00
hash = "sha256-NrWBg0sjaz/uLsNs8/T4MkUgHOUvAWRix1O5usKsw6o=";
};
cargoHash = "sha256-YS8IamapvmdrOPptQh2Ef9Yold0IK1XIeGs0kDIQ5b8=";
2024-04-17 08:32:40 +00:00
NIX_LDFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
"-F${darwin.apple_sdk.frameworks.AppKit}/Library/Frameworks"
"-framework"
"AppKit"
];
nativeBuildInputs = [ pkg-config ]
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) pkg-config
2024-01-01 16:09:44 +00:00
++ lib.optional (installManPages || installShellCompletions) installShellFiles;
2024-01-01 16:09:44 +00:00
buildInputs = [ ]
2024-04-17 08:32:40 +00:00
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa Security ])
++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;
2022-12-21 14:50:04 +00:00
postInstall = lib.optionalString installManPages ''
mkdir -p $out/man
$out/bin/himalaya man $out/man
installManPage $out/man/*
2023-02-08 10:03:41 +00:00
'' + lib.optionalString installShellCompletions ''
installShellCompletion --cmd himalaya \
--bash <($out/bin/himalaya completion bash) \
--fish <($out/bin/himalaya completion fish) \
--zsh <($out/bin/himalaya completion zsh)
'';
meta = with lib; {
2024-01-01 16:09:44 +00:00
description = "CLI to manage emails";
mainProgram = "himalaya";
2024-01-01 16:09:44 +00:00
homepage = "https://pimalaya.org/himalaya/cli/latest/";
2021-10-25 15:36:50 +00:00
changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md";
2022-12-21 14:50:04 +00:00
license = licenses.mit;
maintainers = with maintainers; [ soywod toastal yanganto ];
};
}