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";
2022-02-11 04:40:03 +00:00
version = "0.5.5";
src = fetchFromGitHub {
owner = "soywod";
repo = pname;
rev = "v${version}";
2022-02-11 04:40:03 +00:00
sha256 = "sha256-BZTecYNY8gbGe+r80QWi7FkC56dww9rrtwLfi9ya1mQ=";
};
2022-02-11 04:40:03 +00:00
cargoSha256 = "sha256-2xkKJqp7uf0gh8g2zzDjSl8foTvPj6MVHfDuSr914HU=";
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 ];
};
}