From cc43028aa6ec5585efb67d41c2f1c076fdfde306 Mon Sep 17 00:00:00 2001 From: Yethal <26117918+Yethal@users.noreply.github.com> Date: Fri, 6 Jun 2025 14:45:05 +0200 Subject: [PATCH] nushellPlugins.hcl: init at 0.104.1 --- pkgs/shells/nushell/plugins/default.nix | 1 + pkgs/shells/nushell/plugins/hcl.nix | 36 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/shells/nushell/plugins/hcl.nix diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index 1305cd7183f4..d689e49b43e1 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -22,6 +22,7 @@ lib.makeScope newScope ( }; skim = callPackage ./skim.nix { }; semver = callPackage ./semver.nix { }; + hcl = callPackage ./hcl.nix { }; } // lib.optionalAttrs config.allowAliases { regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; diff --git a/pkgs/shells/nushell/plugins/hcl.nix b/pkgs/shells/nushell/plugins/hcl.nix new file mode 100644 index 000000000000..b0bbe819fb7e --- /dev/null +++ b/pkgs/shells/nushell/plugins/hcl.nix @@ -0,0 +1,36 @@ +{ + stdenv, + lib, + rustPlatform, + pkg-config, + nix-update-script, + fetchFromGitHub, +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell_plugin_hcl"; + version = "0.104.1"; + + src = fetchFromGitHub { + repo = "nu_plugin_hcl"; + owner = "Yethal"; + tag = version; + hash = "sha256-AGTrSLVzbnzMQ2oUuD8Lq4phRt404lSRPiU8Oh9KBG0="; + }; + useFetchCargoVendor = true; + cargoHash = "sha256-5bxE+wN3uAbJSIh0wFS/KA5iTyFiSvFWmj14S/Fmkec="; + + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; + cargoBuildFlags = [ "--package nu_plugin_hcl" ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Nushell plugin for parsing Hashicorp Configuration Language files"; + mainProgram = "nu_plugin_hcl"; + homepage = "https://github.com/Yethal/nu_plugin_hcl"; + license = licenses.mit; + maintainers = with maintainers; [ yethal ]; + platforms = with platforms; all; + }; +}