summary refs log tree commit diff
path: root/pkgs/tools/misc/fend/default.nix
blob: e46b8fe04d42d7a8be680a3e3a486d7c4b4ae88a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, fetchFromGitHub, rustPlatform }:

rustPlatform.buildRustPackage rec {
  pname = "fend";
  version = "0.1.22";

  src = fetchFromGitHub {
    owner = "printfn";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-JuOhJGszsEBBz9G4jjV7OhCAyrSOIktYgoDpYPMk21c=";
  };

  cargoSha256 = "sha256-rKSbsxFt+ntE68eQK6zbIPdOL9JBOgqyqLnb8paVVo0=";

  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 ];
  };
}