1
1
Fork 0

starship: initial program

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-26 00:26:26 -05:00
parent 66f8a9eb17
commit 4ba4d8cfab
Signed by: Myned
GPG key ID: C7224454F7881A34
4 changed files with 531 additions and 0 deletions

View file

@ -20,6 +20,7 @@ with lib; {
nushell.enable = true;
polkit.enable = true;
ssh.enable = true;
starship.enable = true;
sudo.enable = true;
tmux.enable = true;
})

View file

@ -0,0 +1,229 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.custom.programs.starship;
in {
options.custom.programs.starship = {
enable = mkOption {default = false;};
transience = mkOption {default = true;};
};
config = mkIf cfg.enable {
# https://starship.rs/
# https://wiki.nixos.org/wiki/Starship
programs.starship.enable = true;
home-manager.sharedModules = [
{
programs = {
starship = {
enable = true;
enableTransience = cfg.transience;
# https://starship.rs/config/
# https://www.nerdfonts.com/cheat-sheet
settings =
### Presets
# https://starship.rs/presets/
#?? starship preset PRESET | wl-copy
#!! Manually import from preset file
# https://github.com/nix-community/home-manager/issues/4231
recursiveUpdate (
recursiveUpdate
(fromTOML (readFile ./presets/nerd-font-symbols.toml))
(fromTOML (readFile ./presets/no-runtime-versions.toml))
)
{
### Overrides
# https://starship.rs/config/#prompt
add_newline = false;
format = concatStringsSep "" [
# Top left
"$shell"
"$all"
"$fill"
# Top right
"$cmd_duration"
"$time"
"$battery"
"$os"
"$line_break"
# Bottom left
"$jobs"
"$character"
];
# https://starship.rs/config/#battery
battery = {
format = " [$symbol]($style)";
display = [
{
threshold = 15;
style = "bold red";
}
{
threshold = 30;
style = "bold yellow";
}
];
};
# https://starship.rs/config/#character
character = {
error_symbol = "[](bold red) ";
success_symbol = "[](bold) ";
};
# https://starship.rs/config/#command-duration
cmd_duration = {
format = "[󱎫 $duration](#586e75)";
min_time = 5 * 1000; # Milliseconds
};
# https://starship.rs/config/#directory
directory = {
format = " [$path]($style)[$read_only]($read_only_style) ";
repo_root_format = " [$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) ";
style = "bold #657b83";
before_repo_root_style = "bold #586e75";
repo_root_style = "bold";
fish_style_pwd_dir_length = 1;
truncation_length = 1;
truncation_symbol = "/";
use_os_path_sep = false;
};
# https://starship.rs/config/#fill
fill = {
symbol = " ";
};
# https://starship.rs/config/#git-branch
git_branch = {
format = "[$symbol$branch(:$remote_branch)]($style) ";
};
# https://starship.rs/config/#hostname
hostname = {
format = "[[@](#586e75)$hostname]($style) ";
style = "bold";
};
# https://starship.rs/config/#local-ip
localip = {
disabled = false;
};
# https://starship.rs/config/#os
os = {
disabled = false;
style = "bold";
# "ICON " required for proper size
symbols = {
AIX = " ";
Alpaquita = " ";
AlmaLinux = " ";
Alpine = " ";
Amazon = " ";
Android = " ";
Arch = " ";
Artix = " ";
CentOS = " ";
Debian = " ";
DragonFly = " ";
Emscripten = " 󰯁 ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Garuda = " ";
Gentoo = " ";
HardenedBSD = " 󰥯 ";
Illumos = " ";
Kali = " ";
Linux = " 󰌽 ";
Mabox = " ";
Macos = " ";
Manjaro = " ";
Mariner = " ";
MidnightBSD = " 󰖔 ";
Mint = " 󰣭 ";
NetBSD = " ";
NixOS = " ";
OpenBSD = " ";
OpenCloudOS = " ";
openEuler = " 󰏒 ";
openSUSE = " ";
OracleLinux = " ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
RockyLinux = " ";
Redox = " 󰙨 ";
Solus = " ";
SUSE = " ";
Ubuntu = " ";
Ultramarine = " 󰜃 ";
Unknown = " ";
Void = " ";
Windows = " ";
};
};
# https://starship.rs/config/#shell
shell = {
disabled = false;
style = "bold";
bash_indicator = " ";
cmd_indicator = " ";
elvish_indicator = "󰲋 ";
fish_indicator = " ";
ion_indicator = " ";
nu_indicator = "󰟢 ";
powershell_indicator = " ";
tcsh_indicator = " ";
unknown_indicator = " ";
xonsh_indicator = " ";
zsh_indicator = " ";
};
# https://starship.rs/config/#time
time = {
disabled = false;
format = " [$time]($style)";
style = "bold #657b83";
# https://docs.rs/chrono/latest/chrono/format/strftime/index.html
time_format = "%a %b %-d %I:%M%P";
};
# https://starship.rs/config/#username
username = {
format = "[$user]($style)";
style_user = "bold #6c71c4";
show_always = true;
};
};
};
fish.functions = mkIf cfg.transience {
# https://starship.rs/advanced-config/#transientprompt-and-transientrightprompt-in-fish
starship_transient_prompt_func = ''
starship module character
'';
};
};
}
];
};
}

View file

@ -0,0 +1,170 @@
[aws]
symbol = " "
[buf]
symbol = " "
[c]
symbol = " "
[conda]
symbol = " "
[crystal]
symbol = " "
[dart]
symbol = " "
[directory]
read_only = " 󰌾"
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[fennel]
symbol = " "
[fossil_branch]
symbol = " "
[git_branch]
symbol = " "
[git_commit]
tag_symbol = '  '
[golang]
symbol = " "
[guix_shell]
symbol = " "
[haskell]
symbol = " "
[haxe]
symbol = " "
[hg_branch]
symbol = " "
[hostname]
ssh_symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[kotlin]
symbol = " "
[lua]
symbol = " "
[memory_usage]
symbol = "󰍛 "
[meson]
symbol = "󰔷 "
[nim]
symbol = "󰆥 "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[ocaml]
symbol = " "
[os.symbols]
Alpaquita = " "
Alpine = " "
AlmaLinux = " "
Amazon = " "
Android = " "
Arch = " "
Artix = " "
CentOS = " "
Debian = " "
DragonFly = " "
Emscripten = " "
EndeavourOS = " "
Fedora = " "
FreeBSD = " "
Garuda = "󰛓 "
Gentoo = " "
HardenedBSD = "󰞌 "
Illumos = "󰈸 "
Kali = " "
Linux = " "
Mabox = " "
Macos = " "
Manjaro = " "
Mariner = " "
MidnightBSD = " "
Mint = " "
NetBSD = " "
NixOS = " "
OpenBSD = "󰈺 "
openSUSE = " "
OracleLinux = "󰌷 "
Pop = " "
Raspbian = " "
Redhat = " "
RedHatEnterprise = " "
RockyLinux = " "
Redox = "󰀘 "
Solus = "󰠳 "
SUSE = " "
Ubuntu = " "
Unknown = " "
Void = " "
Windows = "󰍲 "
[package]
symbol = "󰏗 "
[perl]
symbol = " "
[php]
symbol = " "
[pijul_channel]
symbol = " "
[python]
symbol = " "
[rlang]
symbol = "󰟔 "
[ruby]
symbol = " "
[rust]
symbol = "󱘗 "
[scala]
symbol = " "
[swift]
symbol = " "
[zig]
symbol = " "
[gradle]
symbol = " "

View file

@ -0,0 +1,131 @@
[bun]
format = "via [$symbol]($style)"
[buf]
format = "via [$symbol]($style)"
[cmake]
format = "via [$symbol]($style)"
[cobol]
format = "via [$symbol]($style)"
[crystal]
format = "via [$symbol]($style)"
[daml]
format = "via [$symbol]($style)"
[dart]
format = "via [$symbol]($style)"
[deno]
format = "via [$symbol]($style)"
[dotnet]
format = "[$symbol(󰓾 $tfm )]($style)"
[elixir]
format = 'via [$symbol]($style)'
[elm]
format = 'via [$symbol]($style)'
[erlang]
format = 'via [$symbol]($style)'
[fennel]
format = 'via [$symbol]($style)'
[gleam]
format = 'via [$symbol]($style)'
[golang]
format = 'via [$symbol]($style)'
[gradle]
format = 'via [$symbol]($style)'
[haxe]
format = 'via [$symbol]($style)'
[helm]
format = 'via [$symbol]($style)'
[java]
format = 'via [$symbol]($style)'
[julia]
format = 'via [$symbol]($style)'
[kotlin]
format = 'via [$symbol]($style)'
[lua]
format = 'via [$symbol]($style)'
[meson]
format = 'via [$symbol]($style)'
[nim]
format = 'via [$symbol]($style)'
[nodejs]
format = 'via [$symbol]($style)'
[ocaml]
format = 'via [$symbol(\($switch_indicator$switch_name\) )]($style)'
[opa]
format = 'via [$symbol]($style)'
[perl]
format = 'via [$symbol]($style)'
[php]
format = 'via [$symbol]($style)'
[pulumi]
format = 'via [$symbol$stack]($style)'
[purescript]
format = 'via [$symbol]($style)'
[python]
format = 'via [$symbol]($style)'
[quarto]
format = 'via [$symbol]($style)'
[raku]
format = 'via [$symbol]($style)'
[red]
format = 'via [$symbol]($style)'
[rlang]
format = 'via [$symbol]($style)'
[ruby]
format = 'via [$symbol]($style)'
[rust]
format = 'via [$symbol]($style)'
[solidity]
format = 'via [$symbol]($style)'
[typst]
format = 'via [$symbol]($style)'
[swift]
format = 'via [$symbol]($style)'
[vagrant]
format = 'via [$symbol]($style)'
[vlang]
format = 'via [$symbol]($style)'
[zig]
format = 'via [$symbol]($style)'