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