diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index 0e00d6618b05..74fcbc2f8399 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -7,16 +7,18 @@ withNativeTls ? true, stdenv, openssl, + versionCheckHook, + nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "xh"; version = "0.24.1"; src = fetchFromGitHub { owner = "ducaale"; repo = "xh"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-2c96O5SL6tcPSbxx8NYxG8LDX3ZgyxEMmEeJnKDwb38="; }; @@ -59,15 +61,21 @@ rustPlatform.buildRustPackage rec { $out/bin/xhs --help > /dev/null ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; + meta = { description = "Friendly and fast tool for sending HTTP requests"; homepage = "https://github.com/ducaale/xh"; - changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/ducaale/xh/blob/v${finalAttrs.version}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ figsoda aaronjheng + defelo ]; mainProgram = "xh"; }; -} +})