{ lib, rustPlatform, fetchFromGitHub, installShellFiles, stdenv, versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "typical"; version = "0.16.0"; src = fetchFromGitHub { owner = "stepchowfun"; repo = "typical"; rev = "v${finalAttrs.version}"; hash = "sha256-+CQIvZC6pv+0cENReRFgP/5lrJr+60A6Lm18mIVvCYc="; }; cargoHash = "sha256-ROp8TJm9J7InHwsKBmYJ5+h8dpad74vgrWWga5Pb3eo="; nativeBuildInputs = [ installShellFiles ]; preCheck = '' export NO_COLOR=true ''; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd typical \ --bash <($out/bin/typical shell-completion bash) \ --fish <($out/bin/typical shell-completion fish) \ --zsh <($out/bin/typical shell-completion zsh) ''; nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; meta = { description = "Data interchange with algebraic data types"; mainProgram = "typical"; homepage = "https://github.com/stepchowfun/typical"; changelog = "https://github.com/stepchowfun/typical/blob/${finalAttrs.src.rev}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = [ ]; }; })