diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index eb8bbe14c281..cdc35b15773b 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -3,6 +3,7 @@ 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; }; regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; net = callPackage ./net.nix { inherit IOKit CoreFoundation; }; diff --git a/pkgs/shells/nushell/plugins/net.nix b/pkgs/shells/nushell/plugins/net.nix index 8386810a194d..d6d17966c460 100644 --- a/pkgs/shells/nushell/plugins/net.nix +++ b/pkgs/shells/nushell/plugins/net.nix @@ -1,10 +1,11 @@ -{ lib -, rustPlatform -, fetchFromGitHub -, stdenv -, IOKit -, CoreFoundation -, unstableGitUpdater +{ + lib, + rustPlatform, + fetchFromGitHub, + stdenv, + IOKit, + CoreFoundation, + unstableGitUpdater, }: rustPlatform.buildRustPackage { @@ -20,9 +21,7 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-nBxcxADyvPgGrfkW8eBq/wmB2Slq+YGJV2IlxuuCgCg="; - nativeBuildInputs = [ - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ rustPlatform.bindgenHook ]; buildInputs = lib.optionals stdenv.isDarwin [ CoreFoundation @@ -36,6 +35,6 @@ rustPlatform.buildRustPackage { homepage = "https://github.com/fennewald/nu_plugin_net"; license = licenses.mit; maintainers = with maintainers; [ happysalada ]; - mainProgram = "nu-plugin-net"; + mainProgram = "nu_plugin_net"; }; } diff --git a/pkgs/shells/nushell/plugins/polars.nix b/pkgs/shells/nushell/plugins/polars.nix new file mode 100644 index 000000000000..4d2c853892cf --- /dev/null +++ b/pkgs/shells/nushell/plugins/polars.nix @@ -0,0 +1,45 @@ +{ + stdenv, + lib, + rustPlatform, + openssl, + nushell, + pkg-config, + IOKit, + Foundation, + nix-update-script, +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell_plugin_polars"; + inherit (nushell) version src; + + cargoHash = "sha256-GkVX12MEHFP4g183zUzOUn4MNeTEBEpB+D5s0OXa4nc="; + + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; + buildInputs = + [ openssl ] + ++ lib.optionals stdenv.isDarwin [ + IOKit + Foundation + ]; + cargoBuildFlags = [ "--package nu_plugin_polars" ]; + + checkPhase = '' + cargo test --manifest-path crates/nu_plugin_polars/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 = "Nushell dataframe plugin commands based on polars."; + mainProgram = "nu_plugin_polars"; + homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_polars"; + license = licenses.mit; + maintainers = with maintainers; [ joaquintrinanes ]; + platforms = with platforms; all; + }; +}