summary refs log tree commit diff
path: root/pkgs/shells/nushell/plugins/formats.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/shells/nushell/plugins/formats.nix')
-rw-r--r--pkgs/shells/nushell/plugins/formats.nix29
1 files changed, 18 insertions, 11 deletions
diff --git a/pkgs/shells/nushell/plugins/formats.nix b/pkgs/shells/nushell/plugins/formats.nix
index 8c511782e3d..15c134018e6 100644
--- a/pkgs/shells/nushell/plugins/formats.nix
+++ b/pkgs/shells/nushell/plugins/formats.nix
@@ -5,25 +5,32 @@
 , pkg-config
 , IOKit
 , Foundation
+, nix-update-script
 }:
 
-let
+rustPlatform.buildRustPackage rec {
   pname = "nushell_plugin_formats";
-in
-rustPlatform.buildRustPackage {
-  inherit pname;
-  version = "0.85.0";
-  src = nushell.src;
-  cargoHash = "sha256-OKtktjBOujvljAX260TbC2sQWZOiGgU+sXsbYRhGPRM=";
+  inherit (nushell) version src;
+  cargoHash = "sha256-fpqXXgvTuRnU4NkJ/B4m3VTkeujE7sMWOma4KEvlxYw=";
+
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ IOKit Foundation ];
+  buildInputs = lib.optionals stdenv.isDarwin [ IOKit Foundation ];
   cargoBuildFlags = [ "--package nu_plugin_formats" ];
-  doCheck = false;
+
+  checkPhase = ''
+    cargo test --manifest-path crates/nu_plugin_formats/Cargo.toml
+  '';
+
+  passthru.updateScript = nix-update-script {
+    # Skip the version check and only check the hash because we inherit version from nushell.
+    extraArgs = [ "--version=skip" ];
+  };
+
   meta = with lib; {
     description = "A formats plugin for Nushell";
-    homepage = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_formats";
+    homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_formats";
     license = licenses.mpl20;
-    maintainers = with maintainers; [ viraptor ];
+    maintainers = with maintainers; [ viraptor aidalgol ];
     platforms = with platforms; all;
   };
 }