about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ca/cargo-typify/package.nix
blob: 6693776c04edac8a43da35241fe6121e3ed16890 (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
29
30
31
32
{ lib, rustfmt, rustPlatform, fetchFromGitHub }:

rustPlatform.buildRustPackage rec {
  pname = "cargo-typify";
  version = "0.0.14";

  src = fetchFromGitHub {
    owner = "oxidecomputer";
    repo = "typify";
    rev = "v${version}";
    hash = "sha256-Clwm5hRjPPPRB6xpO8YOGpqnyNFtsSMkPbWBY3etPCI=";
  };

  cargoHash = "sha256-balx5xOtrWwMOFeGQkYQ2f+lcGMCJvdPqE8rH9adkfU=";

  cargoBuildFlags = [ "-p" "cargo-typify" ];

  nativeCheckInputs = [ rustfmt ];

  preCheck = ''
    # cargo-typify depends on rustfmt-wrapper, which requires RUSTFMT:
    export RUSTFMT="${lib.getExe rustfmt}"
  '';

  meta = with lib; {
    description = "JSON Schema to Rust type converter";
    mainProgram = "cargo-typify";
    homepage = "https://github.com/oxidecomputer/typify";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ david-r-cox ];
  };
}