Skip to content

Commit

Permalink
nushellPlugins.hcl: init at 0.100.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yethal committed Dec 9, 2024
1 parent de75b91 commit f2d104f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 14 deletions.
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24467,6 +24467,11 @@
githubId = 4113027;
name = "Jesper Geertsen Jonsson";
};
yethal = {
github = "yethal";
githubId = 26117918;
name = "Yethal";
};
yinfeng = {
email = "lin.yinfeng@outlook.com";
github = "linyinfeng";
Expand Down
46 changes: 32 additions & 14 deletions pkgs/shells/nushell/plugins/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
{ lib, config, newScope, dbus, IOKit, CoreFoundation, Foundation, Security }:
{
lib,
config,
newScope,
dbus,
IOKit,
CoreFoundation,
Foundation,
Security,
}:

lib.makeScope newScope (self: with self; {
gstat = callPackage ./gstat.nix { inherit Security; };
formats = callPackage ./formats.nix { inherit IOKit Foundation; };
polars = callPackage ./polars.nix { inherit IOKit Foundation; };
query = callPackage ./query.nix { inherit IOKit CoreFoundation; };
net = callPackage ./net.nix { inherit IOKit CoreFoundation; };
units = callPackage ./units.nix { inherit IOKit Foundation; };
highlight = callPackage ./highlight.nix { inherit IOKit Foundation; };
dbus = callPackage ./dbus.nix { inherit dbus; nushell_plugin_dbus = self.dbus; };
skim = callPackage ./skim.nix { inherit IOKit CoreFoundation; };
} // lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
})
lib.makeScope newScope (
self:
with self;
{
gstat = callPackage ./gstat.nix { inherit Security; };
formats = callPackage ./formats.nix { inherit IOKit Foundation; };
polars = callPackage ./polars.nix { inherit IOKit Foundation; };
query = callPackage ./query.nix { inherit IOKit CoreFoundation; };
net = callPackage ./net.nix { inherit IOKit CoreFoundation; };
units = callPackage ./units.nix { inherit IOKit Foundation; };
highlight = callPackage ./highlight.nix { inherit IOKit Foundation; };
dbus = callPackage ./dbus.nix {
inherit dbus;
nushell_plugin_dbus = self.dbus;
};
skim = callPackage ./skim.nix { inherit IOKit CoreFoundation; };
hcl = callPackage ./hcl.nix { inherit IOKit CoreFoundation; };
}
// lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
}
)
43 changes: 43 additions & 0 deletions pkgs/shells/nushell/plugins/hcl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
IOKit,
CoreFoundation,
nix-update-script,
}:

rustPlatform.buildRustPackage rec {
pname = "nu_plugin_hcl";
version = "0.100.0";

src = fetchFromGitHub {
owner = "yethal";
repo = "nu_plugin_hcl";
rev = "refs/tags/${version}";
hash = "sha256-Uj4zzRJ1MtUZBCGc1/wCdh7ZOqLHPQhpdVJBseQR1uE=";
};

cargoHash = "sha256-J4i4lDoXcwU5ecyXiHh/4wwQGqp+dkQkwFHsCr2oNFw=";

nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];

buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
IOKit
CoreFoundation
];

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 = platforms.all;
};
}

0 comments on commit f2d104f

Please sign in to comment.