3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, rustPlatform
, fetchFromGitHub
2021-10-25 16:36:50 +01:00
, stdenv
, enableCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
2021-10-25 16:36:50 +01:00
, installShellFiles
, pkg-config
, Security
, libiconv
2021-10-25 16:36:50 +01:00
, openssl
}:
2021-10-25 16:36:50 +01:00
rustPlatform.buildRustPackage rec {
pname = "himalaya";
2021-10-25 16:36:50 +01:00
version = "0.5.1";
src = fetchFromGitHub {
owner = "soywod";
repo = pname;
rev = "v${version}";
2021-10-25 16:36:50 +01:00
sha256 = "sha256-BmV4kekl0QDbX/ueSrWM5jRvqr6WQeZIs7hiXhiHBSI=";
};
2021-10-25 16:36:50 +01:00
cargoSha256 = "sha256-lu5xVuAw9yTeQr3gpiW5g5bdm7Alf0YXmlbSkPaXhk0=";
2021-10-25 16:36:50 +01:00
nativeBuildInputs = lib.optionals enableCompletions [ installShellFiles ]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
buildInputs =
if stdenv.hostPlatform.isDarwin then [
Security
libiconv
] else [
openssl
];
postInstall = lib.optionalString enableCompletions ''
# Install shell function
installShellCompletion --cmd himalaya \
--bash <($out/bin/himalaya completion bash) \
--fish <($out/bin/himalaya completion fish) \
--zsh <($out/bin/himalaya completion zsh)
'';
meta = with lib; {
description = "CLI email client written in Rust";
homepage = "https://github.com/soywod/himalaya";
2021-10-25 16:36:50 +01:00
changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md";
license = licenses.bsd3;
maintainers = with maintainers; [ yanganto ];
};
}