From 3fb311b7f45f324859321df32d877777ea5a397c Mon Sep 17 00:00:00 2001 From: Merlin Humml Date: Wed, 9 Oct 2024 11:56:41 +0200 Subject: [PATCH] nushellPlugins.units: init at 0.1.2 --- pkgs/shells/nushell/plugins/default.nix | 1 + pkgs/shells/nushell/plugins/units.nix | 36 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/shells/nushell/plugins/units.nix diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index cdc35b15773b..e791e3927485 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -7,4 +7,5 @@ lib.makeScope newScope (self: with self; { query = callPackage ./query.nix { inherit IOKit CoreFoundation; }; regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; net = callPackage ./net.nix { inherit IOKit CoreFoundation; }; + units = callPackage ./units.nix { }; }) diff --git a/pkgs/shells/nushell/plugins/units.nix b/pkgs/shells/nushell/plugins/units.nix new file mode 100644 index 000000000000..ffb231c2bec0 --- /dev/null +++ b/pkgs/shells/nushell/plugins/units.nix @@ -0,0 +1,36 @@ +{ + stdenv, + lib, + rustPlatform, + pkg-config, + nix-update-script, + fetchFromGitHub, +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell_plugin_units"; + version = "0.1.2"; + + src = fetchFromGitHub { + repo = "nu_plugin_units"; + owner = "JosephTLyons"; + rev = "v${version}"; + hash = "sha256-PS16n4j/dg5/+RaliYA18bStNpAecv9aaY2YKXsgLWY="; + }; + cargoHash = "sha256-pxA+6E5luFHq/N0K/8Xk2LapwDnPqDUEpTYqP/jcc3s="; + + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; + buildInputs = [ ]; + cargoBuildFlags = [ "--package nu_plugin_units" ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "A nushell plugin for easily converting between common units."; + mainProgram = "nu_plugin_units"; + homepage = "https://github.com/JosephTLyons/nu_plugin_units"; + license = licenses.mit; + maintainers = with maintainers; [ mgttlinger ]; + platforms = with platforms; all; + }; +}