From 6ad3370cf21b8784befa08307da7dfcb9516f7a8 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:05:37 +0200 Subject: [PATCH 1/5] xh: use finalAttrs pattern --- pkgs/by-name/xh/xh/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index 0e00d6618b05..1c535648bc12 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -9,14 +9,14 @@ openssl, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "xh"; version = "0.24.1"; src = fetchFromGitHub { owner = "ducaale"; repo = "xh"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-2c96O5SL6tcPSbxx8NYxG8LDX3ZgyxEMmEeJnKDwb38="; }; @@ -62,7 +62,7 @@ rustPlatform.buildRustPackage rec { 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 @@ -70,4 +70,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "xh"; }; -} +}) From ad50a01127baca230022ad58d1aae29be8688f40 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:05:58 +0200 Subject: [PATCH 2/5] xh: use tag in fetchFromGitHub --- pkgs/by-name/xh/xh/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index 1c535648bc12..a3b255075dcd 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -16,7 +16,7 @@ rustPlatform.buildRustPackage (finalAttrs: { src = fetchFromGitHub { owner = "ducaale"; repo = "xh"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-2c96O5SL6tcPSbxx8NYxG8LDX3ZgyxEMmEeJnKDwb38="; }; From e13c1026dc25b8c9fdc11faf342196272f322b3a Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:11:00 +0200 Subject: [PATCH 3/5] xh: add versionCheckHook --- pkgs/by-name/xh/xh/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index a3b255075dcd..12d74d2272f4 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -7,6 +7,7 @@ withNativeTls ? true, stdenv, openssl, + versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -59,6 +60,9 @@ rustPlatform.buildRustPackage (finalAttrs: { $out/bin/xhs --help > /dev/null ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + meta = { description = "Friendly and fast tool for sending HTTP requests"; homepage = "https://github.com/ducaale/xh"; From 66516a0bf58891769286e0b07fd91e6ec9ea9647 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:11:00 +0200 Subject: [PATCH 4/5] xh: add updateScript --- pkgs/by-name/xh/xh/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index 12d74d2272f4..69b4ee8cb381 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -8,6 +8,7 @@ stdenv, openssl, versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -63,6 +64,8 @@ rustPlatform.buildRustPackage (finalAttrs: { 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"; From 73f10046fc138a35e0ea031e882d0715c2cb82a5 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:14:17 +0200 Subject: [PATCH 5/5] xh: add defelo as maintainer --- pkgs/by-name/xh/xh/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/xh/xh/package.nix b/pkgs/by-name/xh/xh/package.nix index 69b4ee8cb381..74fcbc2f8399 100644 --- a/pkgs/by-name/xh/xh/package.nix +++ b/pkgs/by-name/xh/xh/package.nix @@ -74,6 +74,7 @@ rustPlatform.buildRustPackage (finalAttrs: { maintainers = with lib.maintainers; [ figsoda aaronjheng + defelo ]; mainProgram = "xh"; };