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