2023-04-03 09:49:01 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
2023-03-31 20:48:53 +02:00
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.eboskma.programs.nushell;
|
2023-04-07 11:20:18 +02:00
|
|
|
|
|
|
|
# TODO: Remove when starship is updated
|
|
|
|
starshipCmd = "${config.home.profileDirectory}/bin/starship";
|
2023-04-13 08:38:40 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
2023-03-31 20:48:53 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.eboskma.programs.nushell = { enable = mkEnableOption "nu shell"; };
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.nushell = {
|
|
|
|
enable = true;
|
2023-04-13 08:38:40 +02:00
|
|
|
package = pkgs.nushell.override { additionalFeatures = p: p ++ [ "dataframe" ]; };
|
2023-03-31 20:48:53 +02:00
|
|
|
configFile.source = ./config.nu;
|
|
|
|
envFile.source = ./env.nu;
|
2023-04-07 11:20:18 +02:00
|
|
|
|
|
|
|
# TODO: Remove when starship is updated to the new nu 0.78 syntax
|
|
|
|
extraEnv = ''
|
|
|
|
let starship_cache = "${config.xdg.cacheHome}/starship"
|
|
|
|
if not ($starship_cache | path exists) {
|
|
|
|
mkdir $starship_cache
|
|
|
|
}
|
|
|
|
${starshipCmd} init nu | str replace --string 'PROMPT_COMMAND = {' 'PROMPT_COMMAND = { ||' | str replace --string 'PROMPT_COMMAND_RIGHT = {' 'PROMPT_COMMAND_RIGHT = { ||' | save --force ${config.xdg.cacheHome}/starship/init.nu
|
|
|
|
'';
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
source ${config.xdg.cacheHome}/starship/init.nu
|
|
|
|
'';
|
|
|
|
|
2023-03-31 20:48:53 +02:00
|
|
|
};
|
2023-04-03 14:34:21 +02:00
|
|
|
|
2023-04-13 08:38:40 +02:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
carapace
|
|
|
|
nushellPlugins.query
|
|
|
|
nushell_plugin_formats
|
|
|
|
];
|
2023-03-31 20:48:53 +02:00
|
|
|
};
|
|
|
|
}
|