Package - nushell - missing support for INI format

Hi,

I have installed nushell via:

# /etc/nixos/configuration.nix
{ config, pkgs, ... }:

{
  # ...
  environment.systemPackages = with pkgs; [
    nushell
    # ...
  ];
}

Which install the version 0.112.2.

When I ran the following nushell command

from --help

the output is

Parse a string or binary data into structured data.

You must use one of the following subcommands. Using this command as-is will only produce this help message.

Usage:
  > from 

Subcommands:
  from csv - Parse text as .csv and create table.
  from json - Convert JSON text into structured data.
  from md - Convert markdown text into structured data.
  from msgpack - Convert MessagePack data into Nu values.
  from msgpackz - Convert brotli-compressed MessagePack data into Nu values.
  from nuon - Convert from nuon to structured data.
  from ods - Parse OpenDocument Spreadsheet(.ods) data and create table.
  from ssv - Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2.
  from toml - Parse text as .toml and create record.
  from tsv - Parse text as .tsv and create table.
  from url - Parse url-encoded string as a record.
  from xlsx - Parse binary Excel(.xlsx) data and create table.
  from xml - Parse text as .xml and create record.
  from yaml - Parse text as .yaml/.yml and create table.
  from yml - Parse text as .yaml/.yml and create table.

# ...

Which means the INI format is not supported.

This is unexpected since nushell (AFAIK) supports this format “natively” (not through a third-party plugin): from ini | Nushell

Question:

Do I need to “pass an extra flag” to activate the support for this format? If so, how?

Link for the nix package nixpkgs/pkgs/by-name/nu/nushell/package.nix at 4382ed2b7a6839d4280a9b386db49cbc5907414d · NixOS/nixpkgs · GitHub

Thank you for reading :slight_smile:

1 Like

It looks like home manager provides programs.nushell.plugins, so you could enable it with something like


{
  programs.nushell = {
    enable = true;
    plugins = [ pkgs.nushellPlugins.formats ];
  };
}

This might work as well:


environment.systemPackages = with pkgs; [
  nushell
  nushellPlugins.formats
];

Surely won’t, given the extra work that the nushell module does:

The answer is always: use the module if there is one!

2 Likes

@waffle8946 could I implement something like this as nushell.withPlugins to avoid requiring home manager? Similar to anki.withAddons, etc.

Yes, probably. Terraform is a good example

Here’s an initial pass at a PR for nushell.withPlugins: nuShell: add withPlugins, mv plugins to by-name/nu/nushell/plugins by andrewzah · Pull Request #543446 · NixOS/nixpkgs · GitHub.

Correct solution is to add `programs.nushell` module that implements plugin registration similar to what Home Manager does, not wrapping somebody’s login shell with bash

2 Likes

Will work on restructuring the PR this evening or the next.

1 Like

Restructured it to use vendor autoloads.