about summary refs log tree commit diff
path: root/pkgs/development/tools/hclfmt
diff options
context:
space:
mode:
authorJonas Chevalier <zimbatm@zimbatm.com>2022-07-25 20:15:58 +0200
committerGitHub <noreply@github.com>2022-07-25 20:15:58 +0200
commiteb5ea1500b4e8a1e9ca6d62b69d6835f80efe3b7 (patch)
treebb73c553007ec1bd865a8b6c48eb8f03646e15c1 /pkgs/development/tools/hclfmt
parent3131757b9ff3a3f113304ff44abc168b969bf8af (diff)
hclfmt: init at 2.12.0 (#182472)
* hclfmt: init at 2.12.0

Co-authored-by: Winter <winter@winter.cafe>
Diffstat (limited to 'pkgs/development/tools/hclfmt')
-rw-r--r--pkgs/development/tools/hclfmt/default.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/development/tools/hclfmt/default.nix b/pkgs/development/tools/hclfmt/default.nix
new file mode 100644
index 0000000000000..2cb25453dbffe
--- /dev/null
+++ b/pkgs/development/tools/hclfmt/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "hclfmt";
+  version = "2.12.0";
+
+  src = fetchFromGitHub {
+    owner = "hashicorp";
+    repo = "hcl";
+    rev = "v${version}";
+    hash = "sha256-tL0jkddKmfQu3a4BDw/RCwQqhRrPf9XWXHl/nG09yVc=";
+  };
+
+  vendorSha256 = "sha256-Wa0tDgHgSPVY6GNxCv9mGWSSi/NuwZq1VO+jwUCMvNI=";
+
+  # The code repository includes other tools which are not useful. Only build
+  # hclfmt.
+  subPackages = [ "cmd/hclfmt" ];
+
+  meta = with lib; {
+    description = "a code formatter for the Hashicorp Configuration Language (HCL) format";
+    homepage = "https://github.com/hashicorp/hcl/tree/main/cmd/hclfmt";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ zimbatm ];
+  };
+}