nushell: add config.nu, env.nu, starship
This commit is contained in:
parent
e596ca6428
commit
2883e717df
5 changed files with 40 additions and 0 deletions
16
parts/pkgs/extraPackages/nushell/config.nu
Normal file
16
parts/pkgs/extraPackages/nushell/config.nu
Normal 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 {}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
aliasesAsString =
|
aliasesAsString =
|
||||||
concatStringsSep "\n"
|
concatStringsSep "\n"
|
||||||
(mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
|
(mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
|
||||||
|
|
||||||
packages = import ./packages.nix {inherit pkgs;};
|
packages = import ./packages.nix {inherit pkgs;};
|
||||||
|
|
||||||
nushell-wrapped = inputs.wrapper-manager.lib.build {
|
nushell-wrapped = inputs.wrapper-manager.lib.build {
|
||||||
|
@ -19,6 +20,17 @@
|
||||||
wrappers.nushell-wrapped = {
|
wrappers.nushell-wrapped = {
|
||||||
basePackage = pkgs.nushell;
|
basePackage = pkgs.nushell;
|
||||||
pathAdd = packages;
|
pathAdd = packages;
|
||||||
|
env.STARSHIP_CONFIG = {
|
||||||
|
force = true;
|
||||||
|
value = ./starship.toml;
|
||||||
|
};
|
||||||
|
flags = [
|
||||||
|
"--env-config"
|
||||||
|
./env.nu
|
||||||
|
|
||||||
|
"--config"
|
||||||
|
./config.nu
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
1
parts/pkgs/extraPackages/nushell/env.nu
Normal file
1
parts/pkgs/extraPackages/nushell/env.nu
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# empty
|
|
@ -27,6 +27,7 @@
|
||||||
asciinema
|
asciinema
|
||||||
inetutils
|
inetutils
|
||||||
scc
|
scc
|
||||||
|
starship
|
||||||
onefetch
|
onefetch
|
||||||
wget
|
wget
|
||||||
cpufetch
|
cpufetch
|
||||||
|
|
10
parts/pkgs/extraPackages/nushell/starship.toml
Normal file
10
parts/pkgs/extraPackages/nushell/starship.toml
Normal 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue