From 2562649f2b5dd4e4f20f02a63e4e401dccd8bfbe Mon Sep 17 00:00:00 2001 From: David Cox Date: Sat, 9 Dec 2023 16:31:47 -1000 Subject: [PATCH] cargo-typify: init at 0.0.14 --- pkgs/by-name/ca/cargo-typify/package.nix | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pkgs/by-name/ca/cargo-typify/package.nix diff --git a/pkgs/by-name/ca/cargo-typify/package.nix b/pkgs/by-name/ca/cargo-typify/package.nix new file mode 100644 index 000000000000..6d62df94c517 --- /dev/null +++ b/pkgs/by-name/ca/cargo-typify/package.nix @@ -0,0 +1,31 @@ +{ 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"; + homepage = "https://github.com/oxidecomputer/typify"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ david-r-cox ]; + }; +}