nushell: add config.nu, env.nu, starship

This commit is contained in:
Charlie Root 2024-09-16 21:01:10 +02:00
commit 2883e717df
5 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,16 @@
let starship_installed = not (which starship | is-empty)
$env.config = {
show_banner: false
}
if $starship_installed {
$env.STARSHIP_SHELL = "nu"
$env.STARSHIP_SESSION_KEY = (random chars -l 16)
$env.STARSHIP_SESSION_KEY = (random chars -l 16)
$env.PROMPT_MULTILINE_INDICATOR = (starship prompt --continuation)
# $env.PROMPT_INDICATOR = "$ "
$env.PROMPT_COMMAND = {|| starship prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" }
$env.PROMPT_COMMAND_RIGHT = ''
} else {}

View file

@ -10,6 +10,7 @@
aliasesAsString =
concatStringsSep "\n"
(mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
packages = import ./packages.nix {inherit pkgs;};
nushell-wrapped = inputs.wrapper-manager.lib.build {
@ -19,6 +20,17 @@
wrappers.nushell-wrapped = {
basePackage = pkgs.nushell;
pathAdd = packages;
env.STARSHIP_CONFIG = {
force = true;
value = ./starship.toml;
};
flags = [
"--env-config"
./env.nu
"--config"
./config.nu
];
};
}
];

View file

@ -0,0 +1 @@
# empty

View file

@ -27,6 +27,7 @@
asciinema
inetutils
scc
starship
onefetch
wget
cpufetch

View file

@ -0,0 +1,10 @@
[directory]
style = "bold cyan"
read_only = " "
truncate_to_repo = false
#truncation_length = 0
format = "[󰉋 $path]($style)([$read_only]($read_only_style))"
#repo_root_style = "red"
home_symbol = "~"
#disabled = true