nushellPlugins: format plugin and fix darwin

Fix compilation under darwin and add the formats plugin to support ini,
ical and others.
This commit is contained in:
Stanisław Pitucha 2023-09-07 23:31:03 +10:00 committed by Yt
parent f30382d05c
commit 9ca9bd1a81
4 changed files with 35 additions and 4 deletions

View file

@ -1,6 +1,7 @@
{ lib, newScope, IOKit, CoreFoundation }:
{ lib, newScope, IOKit, CoreFoundation, Foundation, Security }:
lib.makeScope newScope (self: with self; {
gstat = callPackage ./gstat.nix { };
gstat = callPackage ./gstat.nix { inherit Security; };
formats = callPackage ./formats.nix { inherit IOKit Foundation; };
query = callPackage ./query.nix { inherit IOKit CoreFoundation; };
})

View file

@ -0,0 +1,29 @@
{ stdenv
, lib
, rustPlatform
, nushell
, pkg-config
, IOKit
, Foundation
}:
let
pname = "nushell_plugin_formats";
in
rustPlatform.buildRustPackage {
inherit pname;
version = "0.84.0";
src = nushell.src;
cargoHash = "sha256-pwOdSJHd9njR0lr4n2EzCcqRonh0cbBHGZgAJ1l8FEk=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ IOKit Foundation ];
cargoBuildFlags = [ "--package nu_plugin_formats" ];
doCheck = false;
meta = with lib; {
description = "A formats plugin for Nushell";
homepage = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_formats";
license = licenses.mpl20;
maintainers = with maintainers; [ viraptor ];
platforms = with platforms; all;
};
}

View file

@ -4,6 +4,7 @@
, openssl
, nushell
, pkg-config
, Security
}:
let
@ -15,7 +16,7 @@ rustPlatform.buildRustPackage {
src = nushell.src;
cargoHash = "sha256-RcwCYfIEV0+NbZ99uWaCOLqLap3wZ4qXIsc02fqkBSQ=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
cargoBuildFlags = [ "--package nu_plugin_gstat" ];
doCheck = false; # some tests fail
meta = with lib; {

View file

@ -28512,7 +28512,7 @@ with pkgs;
nu_scripts = callPackage ../shells/nushell/nu_scripts { };
nushellPlugins = callPackage ../shells/nushell/plugins {
inherit (darwin.apple_sdk_11_0.frameworks) IOKit CoreFoundation;
inherit (darwin.apple_sdk_11_0.frameworks) IOKit CoreFoundation Foundation Security;
};
nettools = if stdenv.isLinux