about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2023-10-22 18:40:49 +0100
committerYt <happysalada@tuta.io>2023-10-23 12:39:21 +0000
commitcee03e7670305dac6e28b815f01095adc4a62057 (patch)
tree64cda683498c21b55d5f758f77e135e0f7210817 /pkgs/shells
parent100603f1ad8dfbd09ac76db4456d692bb9375b11 (diff)
nushellPlugins.net: init at unstable-2023-09-27
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/nushell/plugins/default.nix1
-rw-r--r--pkgs/shells/nushell/plugins/net.nix43
2 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix
index dfe2a4062c89a..bb3f631cf225d 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 0000000000000..940b2d0aff021
--- /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";
+  };
+}