From 4e56e3266af4be249f00545089fde210b6c64a36 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:41:23 -0800 Subject: [PATCH] starship --- users/tao/home.nix | 54 ++++++--------- users/tao/starship.toml | 150 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 31 deletions(-) create mode 100644 users/tao/starship.toml diff --git a/users/tao/home.nix b/users/tao/home.nix index 8888f02..84da25d 100644 --- a/users/tao/home.nix +++ b/users/tao/home.nix @@ -1,42 +1,34 @@ +let + enablePrograms = programs: builtins.mapAttrs (_: program: { enable = true; }) programs; +in { imports = [ ./helix.nix ]; - programs.nushell = { - enable = true; - configFile.source = ./config.nu; - envFile.source = ./env.nu; - }; - - programs.git = { - enable = true; - userName = "Tao Tien"; - userEmail = "29749622+taotien@users.noreply.github.com"; - }; - - programs.starship = { - enable = true; - enableNushellIntegration = true; - settings = { - nix_shell = { - disabled = false; - impure_msg = ";[impure shell](bold red)"; - pure_msg = ";[pure shell](bold green)"; - unknown_msg = ";[unknown shell](bold yellow)"; - format = "via [☃️ $state( \($name\))](bold blue)"; - }; + programs = enablePrograms { + git = { + userName = "Tao Tien"; + userEmail = "29749622+taotien@users.noreply.github.com"; }; - }; - programs.wezterm = { - enable = true; - extraConfig = builtins.readFile ./wezterm.lua; - }; + nushell = { + configFile.source = ./config.nu; + envFile.source = ./env.nu; + }; - programs.zoxide = { - enable = true; - enableNushellIntegration = true; + starshell = { + enableNuShellIntegration = true; + settings = builtins.fromTOML (builtins.readFile ./starship.nix); + }; + + wezterm = { + extraConfig = builtins.readFile ./wezterm.lua; + }; + + zoxide = { + enableNushellIntegration = true; + }; }; home.username = "tao"; diff --git a/users/tao/starship.toml b/users/tao/starship.toml new file mode 100644 index 0000000..ce98942 --- /dev/null +++ b/users/tao/starship.toml @@ -0,0 +1,150 @@ +format = """ +[](#9A348E)\ +$username\ +[](bg:#DA627D fg:#9A348E)\ +$directory\ +[](fg:#DA627D bg:#FCA17D)\ +$git_branch\ +$git_status\ +[](fg:#FCA17D bg:#86BBD8)\ +$c\ +$elixir\ +$elm\ +$golang\ +$gradle\ +$haskell\ +$java\ +$julia\ +$nodejs\ +$nim\ +$rust\ +$scala\ +[](fg:#86BBD8 bg:#06969A)\ +$docker_context\ +[](fg:#06969A bg:#33658A)\ +[ ](fg:#33658A)\ +$nix_shell\ +""" + +# Disable the blank line at the start of the prompt +# add_newline = false + +# You can also replace your username with a neat symbol like  or disable this +# and use the os module below +[username] +show_always = true +style_user = "bg:#9A348E" +style_root = "bg:#9A348E" +format = '[$user ]($style)' +disabled = false + +# An alternative to the username module which displays a symbol that +# represents the current operating system +[os] +style = "bg:#9A348E" +disabled = true # Disabled by default + +[directory] +style = "bg:#DA627D" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +# Here is how you can shorten some long paths by text replacement +# similar to mapped_locations in Oh My Posh: +[directory.substitutions] +"Documents" = " " +"Downloads" = " " +"Music" = " " +"Pictures" = " " +# Keep in mind that the order matters. For example: +# "Important Documents" = "  " +# will not be replaced, because "Documents" was already substituted before. +# So either put "Important Documents" before "Documents" or use the substituted version: +# "Important  " = "  " + +[c] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[docker_context] +symbol = " " +style = "bg:#06969A" +format = '[ $symbol $context ]($style) $path' + +[elixir] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[elm] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[git_branch] +symbol = "" +style = "bg:#FCA17D" +format = '[ $symbol $branch ]($style)' + +[git_status] +style = "bg:#FCA17D" +format = '[$all_status$ahead_behind ]($style)' + +[golang] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[gradle] +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[haskell] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[java] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[julia] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[nodejs] +symbol = "" +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[nim] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[rust] +symbol = "" +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[scala] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[time] +disabled = false +time_format = "%R" # Hour:Minute Format +style = "bg:#33658A" +format = '[ ♥ $time ]($style)' + +[nix_shell] +disabled = false +impure_msg = '[impure shell](bold red)' +pure_msg = '[pure shell](bold green)' +unknown_msg = '[unknown shell](bold yellow)' +format = 'via [☃️ $state( \($name\))](bold blue)'