nix-init: modernize (#427894)

authored by Aleksana and committed by GitHub 3480b519 238d8bf8

+14 -13
+14 -13
pkgs/by-name/ni/nix-init/package.nix
··· 11 11 openssl, 12 12 zlib, 13 13 zstd, 14 - stdenv, 15 14 spdx-license-list-data, 16 15 nix, 17 16 nurl, 18 - testers, 19 - nix-init, 17 + versionCheckHook, 18 + nix-update-script, 20 19 }: 21 20 22 21 let ··· 25 24 }; 26 25 in 27 26 28 - rustPlatform.buildRustPackage rec { 27 + rustPlatform.buildRustPackage (finalAttrs: { 29 28 pname = "nix-init"; 30 29 version = "0.3.2"; 31 30 32 31 src = fetchFromGitHub { 33 32 owner = "nix-community"; 34 33 repo = "nix-init"; 35 - rev = "v${version}"; 34 + tag = "v${finalAttrs.version}"; 36 35 hash = "sha256-0RLEPVtYnwYH+pMnpO0/Evbp7x9d0RMobOVAqwgMJz4="; 37 36 }; 38 37 ··· 87 86 ZSTD_SYS_USE_PKG_CONFIG = true; 88 87 }; 89 88 90 - passthru.tests.version = testers.testVersion { 91 - package = nix-init; 92 - }; 89 + nativeInstallCheckInputs = [ versionCheckHook ]; 90 + versionCheckProgramArg = "--version"; 91 + doInstallCheck = true; 92 + 93 + passthru.updateScript = nix-update-script { }; 93 94 94 - meta = with lib; { 95 + meta = { 95 96 description = "Command line tool to generate Nix packages from URLs"; 96 97 mainProgram = "nix-init"; 97 98 homepage = "https://github.com/nix-community/nix-init"; 98 - changelog = "https://github.com/nix-community/nix-init/blob/${src.rev}/CHANGELOG.md"; 99 - license = licenses.mpl20; 100 - maintainers = with maintainers; [ figsoda ]; 99 + changelog = "https://github.com/nix-community/nix-init/blob/${finalAttrs.src.tag}/CHANGELOG.md"; 100 + license = lib.licenses.mpl20; 101 + maintainers = with lib.maintainers; [ figsoda ]; 101 102 }; 102 - } 103 + })