From cee03e7670305dac6e28b815f01095adc4a62057 Mon Sep 17 00:00:00 2001 From: happysalada Date: Sun, 22 Oct 2023 18:40:49 +0100 Subject: [PATCH] nushellPlugins.net: init at unstable-2023-09-27 --- pkgs/shells/nushell/plugins/default.nix | 1 + pkgs/shells/nushell/plugins/net.nix | 43 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/shells/nushell/plugins/net.nix diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index dfe2a4062c89..bb3f631cf225 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -5,4 +5,5 @@ lib.makeScope newScope (self: with self; { formats = callPackage ./formats.nix { inherit IOKit Foundation; }; query = callPackage ./query.nix { inherit IOKit CoreFoundation; }; regex = callPackage ./regex.nix { }; + net = callPackage ./net.nix { inherit IOKit CoreFoundation; }; }) diff --git a/pkgs/shells/nushell/plugins/net.nix b/pkgs/shells/nushell/plugins/net.nix new file mode 100644 index 000000000000..940b2d0aff02 --- /dev/null +++ b/pkgs/shells/nushell/plugins/net.nix @@ -0,0 +1,43 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, stdenv +, IOKit +, CoreFoundation +, nix-update-script +}: + +rustPlatform.buildRustPackage { + pname = "nu-plugin-net"; + version = "unstable-2023-09-27"; + + src = fetchFromGitHub { + owner = "fennewald"; + repo = "nu_plugin_net"; + rev = "1761ed3d7f68925f1234316bd62c91d1d9d7cb4d"; + hash = "sha256-ZEktfN/zg/VIiBGq/o0T05tLViML2TzfuLw0qliPQg8="; + }; + + cargoHash = "sha256-bRw9V75VnOL1n2jPs6QI/A3pik00pGiA9ZzQk1F1JRI="; + + nativeBuildInputs = [ + rustPlatform.bindgenHook + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + CoreFoundation + IOKit + ]; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = with lib; { + description = "A nushell plugin to list system network interfaces"; + homepage = "https://github.com/fennewald/nu_plugin_net"; + license = licenses.mit; + maintainers = with maintainers; [ happysalada ]; + mainProgram = "nu-plugin-net"; + }; +}