yaml2json: cleanup, add versionCheckHook, nix-update-script

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>

+14 -5
+14 -5
pkgs/by-name/ya/yaml2json/package.nix
··· 2 2 lib, 3 3 buildGoModule, 4 4 fetchFromGitHub, 5 + versionCheckHook, 6 + nix-update-script, 5 7 }: 6 8 7 - buildGoModule rec { 9 + buildGoModule (finalAttrs: { 8 10 pname = "yaml2json"; 9 11 version = "1.3.5"; 10 12 11 13 src = fetchFromGitHub { 12 14 owner = "bronze1man"; 13 15 repo = "yaml2json"; 14 - rev = "v${version}"; 16 + tag = "v${finalAttrs.version}"; 15 17 hash = "sha256-mIjtR1VsSeUhEgeSKDG0qT0kj+NCqVwn31m300cMDeU="; 16 18 }; 17 19 ··· 24 26 "-w" 25 27 ]; 26 28 27 - meta = with lib; { 29 + nativeCheckInputs = [ versionCheckHook ]; 30 + versionCheckProgramArg = "--version"; 31 + doInstallCheck = true; 32 + 33 + passthru.updateScript = nix-update-script { }; 34 + 35 + meta = { 28 36 homepage = "https://github.com/bronze1man/yaml2json"; 37 + changelog = "https://github.com/bronze1man/yaml2json/releases/tag/v${finalAttrs.version}"; 29 38 description = "Convert yaml to json"; 30 39 mainProgram = "yaml2json"; 31 - license = with licenses; [ mit ]; 40 + license = with lib.licenses; [ mit ]; 32 41 maintainers = [ ]; 33 42 }; 34 - } 43 + })