diff --git a/pkgs/by-name/md/mdq/package.nix b/pkgs/by-name/md/mdq/package.nix new file mode 100644 index 000000000000..fdd5bb8a309e --- /dev/null +++ b/pkgs/by-name/md/mdq/package.nix @@ -0,0 +1,40 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + nix-update-script, + versionCheckHook, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "mdq"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "yshavit"; + repo = "mdq"; + tag = "v${finalAttrs.version}"; + hash = "sha256-IMDyPIuG5Zyp323XYsFcFo0yNimCm2DV9rY+Ac0DiZo="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-GxQ9YyofalnIP3EtGVpIpg7s8QW2d1Z/gFF2CUBg1P0="; + + passthru.updateScript = nix-update-script { }; + + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + + meta = { + description = "Like jq but for Markdown: find specific elements in a md doc"; + homepage = "https://github.com/yshavit/mdq"; + changelog = "https://github.com/yshavit/mdq/releases/tag/v${finalAttrs.version}"; + license = with lib.licenses; [ + mit + asl20 + ]; + maintainers = with lib.maintainers; [ DimitarNestorov ]; + mainProgram = "mdq"; + }; +})