diff --git a/pkgs/by-name/ca/cargo-shuttle/package.nix b/pkgs/by-name/ca/cargo-shuttle/package.nix index fcdc4a83d3d2..994306bf9b9c 100644 --- a/pkgs/by-name/ca/cargo-shuttle/package.nix +++ b/pkgs/by-name/ca/cargo-shuttle/package.nix @@ -5,16 +5,17 @@ pkg-config, openssl, zlib, + versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-shuttle"; version = "0.57.3"; src = fetchFromGitHub { owner = "shuttle-hq"; repo = "shuttle"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-qPevl75wmOYVhTgMiJOi+6j8LBWKzM7HPhd5mdf2B+8="; }; @@ -32,17 +33,21 @@ rustPlatform.buildRustPackage rec { "cargo-shuttle" ]; - cargoTestFlags = cargoBuildFlags ++ [ + cargoTestFlags = finalAttrs.cargoBuildFlags ++ [ # other tests are failing for different reasons "init::shuttle_init_tests::" ]; - meta = with lib; { + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + + meta = { description = "Cargo command for the shuttle platform"; mainProgram = "cargo-shuttle"; homepage = "https://shuttle.rs"; - changelog = "https://github.com/shuttle-hq/shuttle/releases/tag/${src.rev}"; - license = licenses.asl20; - maintainers = [ maintainers.progrm_jarvis ]; + changelog = "https://github.com/shuttle-hq/shuttle/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.progrm_jarvis ]; }; -} +})