{ lib , stdenv , fetchFromGitHub , rustPlatform , darwin }: rustPlatform.buildRustPackage rec { pname = "fend"; version = "1.0.5"; src = fetchFromGitHub { owner = "printfn"; repo = pname; rev = "v${version}"; sha256 = "sha256-y5r9/e3KbEojRIoGG9gBkVbxGrJJJhwVZiiTkpy4NtE="; }; cargoSha256 = "sha256-iv3Uo3XUAxf+CmiRBm8EzQ2GhglPVqbN/LSofTa6ujw="; buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; doInstallCheck = true; installCheckPhase = '' [[ "$($out/bin/fend "1 km to m")" = "1000 m" ]] ''; meta = with lib; { description = "Arbitrary-precision unit-aware calculator"; homepage = "https://github.com/printfn/fend"; license = licenses.mit; maintainers = with maintainers; [ djanatyn ]; }; }