nushell: Add query and formats plugins, config tweak

This commit is contained in:
Erwin Boskma 2023-04-13 08:38:40 +02:00
parent b23ccd1515
commit 4abad48960
Signed by: erwin
SSH key fingerprint: SHA256:Vw4O4qA0i5x65Y7yyjDpWDCSMSXAhqT4X7cJ3frdnLY
6 changed files with 51 additions and 5 deletions

View file

@ -5,6 +5,12 @@ let
# TODO: Remove when starship is updated
starshipCmd = "${config.home.profileDirectory}/bin/starship";
nushell_plugin_formats = pkgs.callPackage ./plugin-formats.nix {
inherit (pkgs) stdenv lib rustPlatform;
inherit (pkgs.darwin.apple_sdk_11_0.frameworks) IOKit CoreFoundation;
nushell = config.programs.nushell.package;
};
in
{
options.eboskma.programs.nushell = { enable = mkEnableOption "nu shell"; };
@ -12,6 +18,7 @@ in
config = mkIf cfg.enable {
programs.nushell = {
enable = true;
package = pkgs.nushell.override { additionalFeatures = p: p ++ [ "dataframe" ]; };
configFile.source = ./config.nu;
envFile.source = ./env.nu;
@ -30,6 +37,10 @@ in
};
home.packages = [ pkgs.carapace ];
home.packages = with pkgs; [
carapace
nushellPlugins.query
nushell_plugin_formats
];
};
}

View file

@ -26,14 +26,14 @@ let-env ENV_CONVERSIONS = {
#
# By default, <nushell-config-dir>/scripts is added
let-env NU_LIB_DIRS = [
($nu.config-path | path dirname | path join 'scripts')
($env.HOME | path join '.config' 'nushell' 'scripts')
]
# Directories to search for plugin binaries when calling register
#
# By default, <nushell-config-dir>/plugins is added
let-env NU_PLUGIN_DIRS = [
($nu.config-path | path dirname | path join 'plugins')
($env.HOME | path join '.config' 'nushell' 'plugins')
]
# To add entries to PATH (on Windows you might use Path), you can use the following pattern:

View file

@ -0,0 +1,34 @@
{ stdenv
, lib
, rustPlatform
, nushell
, IOKit
, CoreFoundation
}:
let
pname = "nushell_plugin_formats";
in
rustPlatform.buildRustPackage {
inherit pname;
version = nushell.version;
src = nushell.src;
cargoHash = "sha256-7cMUFCG6tL/Mj3An1+HA8Z7auBkJ/nvgPc/mm+t074E=";
buildInputs = lib.optionals stdenv.isDarwin [ IOKit CoreFoundation ];
cargoBuildFlags = [ "--package nu_plugin_formats" ];
# compilation fails with a missing symbol
doCheck = false;
meta = with lib; {
description = "A Nushell plugin to convert various data formats";
homepage = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_formats";
license = licenses.mpl20;
maintainers = [{ email = "erwin@datarift.nl"; github = "eboskma"; name = "Erwin Boskma"; githubId = 346752; }];
platforms = with platforms; all;
};
}

View file

@ -184,6 +184,8 @@
services.cpupower-gui.enable = true;
services.flatpak.enable = true;
services.tailscale.enable = true;
services.xserver.libinput = {
enable = true;
mouse = {

View file

@ -115,7 +115,6 @@ in
minio-client
mpv
nordzy-cursor-theme
nushell
pamedia
pass
quintom-cursor-theme