diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/mailreaders/himalaya')
-rw-r--r-- | nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix new file mode 100644 index 000000000000..33c1cc63a7f9 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix @@ -0,0 +1,52 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, stdenv +, enableCompletions ? stdenv.hostPlatform == stdenv.buildPlatform +, installShellFiles +, pkg-config +, Security +, libiconv +, openssl +}: + +rustPlatform.buildRustPackage rec { + pname = "himalaya"; + version = "0.5.1"; + + src = fetchFromGitHub { + owner = "soywod"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-BmV4kekl0QDbX/ueSrWM5jRvqr6WQeZIs7hiXhiHBSI="; + }; + + cargoSha256 = "sha256-lu5xVuAw9yTeQr3gpiW5g5bdm7Alf0YXmlbSkPaXhk0="; + + 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"; + changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md"; + license = licenses.bsd3; + maintainers = with maintainers; [ yanganto ]; + }; +} |