From b0657b6185e3d45fed9a5d5282f34bd52dbf794c Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 21 May 2023 22:31:23 -0400 Subject: [PATCH] jsonfmt: init at 0.5.0 https://github.com/caarlos0/jsonfmt --- .../tools/misc/jsonfmt/default.nix | 40 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/tools/misc/jsonfmt/default.nix diff --git a/pkgs/development/tools/misc/jsonfmt/default.nix b/pkgs/development/tools/misc/jsonfmt/default.nix new file mode 100644 index 000000000000..e11828df7f59 --- /dev/null +++ b/pkgs/development/tools/misc/jsonfmt/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, testers +, jsonfmt +}: + +buildGoModule rec { + pname = "jsonfmt"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "caarlos0"; + repo = "jsonfmt"; + rev = "v${version}"; + hash = "sha256-rVv7Dv4vQmss4eiiy+KaO9tZ5U58WlRlsOz4QO0gdfM="; + }; + + vendorHash = "sha256-xtwN+TemiiyXOxZ2DNys4G6w4KA3BjLSWAmzox+boMY="; + + ldflags = [ + "-s" + "-w" + "-X=main.version=${version}" + ]; + + passthru.tests = { + version = testers.testVersion { + package = jsonfmt; + }; + }; + + meta = with lib; { + description = "Formatter for JSON files"; + homepage = "https://github.com/caarlos0/jsonfmt"; + changelog = "https://github.com/caarlos0/jsonfmt/releases/tag/${src.rev}"; + license = licenses.mit; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3c2a437a0b52..bc0c902401c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8963,6 +8963,8 @@ with pkgs; json-schema-for-humans = with python3Packages; toPythonApplication json-schema-for-humans; + jsonfmt = callPackage ../development/tools/misc/jsonfmt { }; + jsonwatch = callPackage ../tools/misc/jsonwatch { inherit (darwin.apple_sdk.frameworks) Security; };