From 896a8eca46f57db006a09eae450fdde9f63c1ee6 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Thu, 4 Dec 2025 22:09:08 +0300 Subject: [PATCH] rust-petname: use finalAttrs --- pkgs/by-name/ru/rust-petname/package.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ru/rust-petname/package.nix b/pkgs/by-name/ru/rust-petname/package.nix index b3816ff06781..ab1148404ce1 100644 --- a/pkgs/by-name/ru/rust-petname/package.nix +++ b/pkgs/by-name/ru/rust-petname/package.nix @@ -2,25 +2,30 @@ lib, rustPlatform, fetchCrate, + versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "rust-petname"; version = "2.0.2"; src = fetchCrate { - inherit version; + inherit (finalAttrs) version; crateName = "petname"; hash = "sha256-KP+GdGlwLHcKE8nAmFr2wHbt5RD9Ptpiz1X5HgJ6BgU="; }; cargoHash = "sha256-gZxZeirvGHwm8C87HdCBYr30+0bbjwnWxIQzcLgl3iQ="; - meta = with lib; { + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + + meta = { description = "Generate human readable random names"; homepage = "https://github.com/allenap/rust-petname"; - license = licenses.asl20; - maintainers = [ maintainers.progrm_jarvis ]; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.progrm_jarvis ]; mainProgram = "petname"; }; -} +})