diff --git a/pkgs/by-name/ai/air-formatter/package.nix b/pkgs/by-name/ai/air-formatter/package.nix index e489b2cfa0e9..651668ce045a 100644 --- a/pkgs/by-name/ai/air-formatter/package.nix +++ b/pkgs/by-name/ai/air-formatter/package.nix @@ -2,30 +2,43 @@ lib, rustPlatform, fetchFromGitHub, + versionCheckHook, + nix-update-script, }: -rustPlatform.buildRustPackage (attrs: { +rustPlatform.buildRustPackage (finalAttrs: { pname = "air-formatter"; - version = "0.4.0"; + version = "0.4.1"; src = fetchFromGitHub { owner = "posit-dev"; repo = "air"; - rev = attrs.version; - hash = "sha256-BUbOG4D5UD+Z8Cpr4qodUrM3FFcMwjBd4M/YdPZPtpM="; + tag = finalAttrs.version; + hash = "sha256-ePTbXwOYIJF8xsiHR03EUwQnKP8KSN/8S8iRY8ME988="; }; # Remove duplicate entries from cargo lock cargoPatches = [ ./cargo-lock.patch ]; useFetchCargoVendor = true; - cargoHash = "sha256-EnvhqAZK76O6g99OgLruQDBUe9m9bn5ier3bgHI/f+A="; + cargoHash = "sha256-EHhelQDXGLZqbUia84OqU7frlRBXfi2oPDxhLuW7d64="; useNextest = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/air"; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + meta = { description = "An extremely fast R code formatter"; homepage = "https://posit-dev.github.io/air"; - changelog = "https://github.com/posit-dev/air/blob/" + attrs.version + "/CHANGELOG.md"; + changelog = "https://github.com/posit-dev/air/blob/${finalAttrs.version}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = [ lib.maintainers.kupac ]; mainProgram = "air";