From bee861240dd68621cdb4b48321d45595854fd0dd Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 24 Jun 2025 03:39:08 +0900 Subject: [PATCH] dprint: prefer versionCheckHook --- pkgs/by-name/dp/dprint/package.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/dp/dprint/package.nix b/pkgs/by-name/dp/dprint/package.nix index 882f55d065d3..b89a9515e2e0 100644 --- a/pkgs/by-name/dp/dprint/package.nix +++ b/pkgs/by-name/dp/dprint/package.nix @@ -4,9 +4,9 @@ fetchFromGitHub, rustPlatform, installShellFiles, - testers, + writableTmpDirAsHomeHook, + versionCheckHook, nix-update-script, - dprint, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -62,16 +62,16 @@ rustPlatform.buildRustPackage (finalAttrs: { --fish <($out/bin/dprint completions fish) ''; + nativeInstallCheckInputs = [ + writableTmpDirAsHomeHook + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgram = "${placeholder "out"}/bin/dprint"; + versionCheckProgramArg = "--version"; + versionCheckKeepEnvironment = [ "HOME" ]; + passthru = { - tests.version = testers.testVersion { - inherit (finalAttrs) version; - - package = dprint; - command = '' - DPRINT_CACHE_DIR="$(mktemp --directory)" dprint --version - ''; - }; - updateScript = nix-update-script { }; };