nixos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit e09a99231e1c1fbffc68e44e9efdf3163dcd88ae
parent ceb048384e1dbf183e091bab09c66b2da377745b
Author: Toni Brown <me@tb148.net>
Date:   Fri, 24 Apr 2026 20:56:47 +0800

use carapace and starship

Diffstat:
Mhome.nix | 4++++
Mhome/nushell/config.nu | 82-------------------------------------------------------------------------------
2 files changed, 4 insertions(+), 82 deletions(-)

diff --git a/home.nix b/home.nix @@ -68,6 +68,8 @@ programs.bat.enable = true; + programs.carapace.enable = true; + programs.direnv.enable = true; programs.fastfetch.enable = true; @@ -82,6 +84,8 @@ programs.pay-respects.enable = true; + programs.starship.enable = true; + programs.thunderbird.enable = true; programs.thunderbird.profiles.default.isDefault = true; diff --git a/home/nushell/config.nu b/home/nushell/config.nu @@ -1,87 +1,5 @@ $env.config.buffer_editor = "hx" $env.config.show_banner = false -$env.config.completions.external = { - enable: true - max_results: 100 - completer: {|spans| - fish --command $"complete '--do-complete=($spans | str replace --all "'" "\\'" | str join ' ')'" - | from tsv --flexible --noheaders --no-infer - | rename value description - | update value {|row| - let value = $row.value - let need_quote = ['\' ',' '[' ']' '(' ')' ' ' '\t' "'" '"' "`"] | any { $in in $value } - if ($need_quote and ($value | path exists)) { - let expanded_path = if ($value starts-with ~) { $value | path expand --no-symlink } else { $value } - $'"($expanded_path | str replace --all "\"" "\\\"")"' - } else { $value } - } - } -} - -let theme = { - rosewater: "#f5e0dc" - flamingo: "#f2cdcd" - pink: "#f5c2e7" - mauve: "#cba6f7" - red: "#f38ba8" - maroon: "#eba0ac" - peach: "#fab387" - yellow: "#f9e2af" - green: "#a6e3a1" - teal: "#94e2d5" - sky: "#89dceb" - sapphire: "#74c7ec" - blue: "#89b4fa" - lavender: "#b4befe" - text: "#cdd6f4" - subtext1: "#bac2de" - subtext0: "#a6adc8" - overlay2: "#9399b2" - overlay1: "#7f849c" - overlay0: "#6c7086" - surface2: "#585b70" - surface1: "#45475a" - surface0: "#313244" - base: "#1e1e2e" - mantle: "#181825" - crust: "#11111b" -} - -def color [color: string] {$"(ansi $color)($in)(ansi rst)"} - -$env.PROMPT_COMMAND = {|| - let user_host = $"(whoami)@(sys host | get hostname)" - let last_exit_code = if $env.LAST_EXIT_CODE > 0 {$env.LAST_EXIT_CODE | fill -a right -c '0' -w 3} else {""} - ($user_host | color $theme.yellow) + ("@" | color $theme.text) + (pwd | color $theme.blue) + "\n" + ($last_exit_code | color $theme.red) -} -$env.PROMPT_COMMAND_RIGHT = {|| - let now = date now - let duration = if $env.CMD_DURATION_MS == "0823" {0sec} else {$env.CMD_DURATION_MS | into duration -u ms} - let then = $now - $duration - $"($then | format date "%H:%M:%S") + ($duration) = ($now | format date "%H:%M:%S")" | color $theme.overlay1 -} -$env.PROMPT_INDICATOR = {|| - let indicator_color = if $env.LAST_EXIT_CODE > 0 {$theme.red} else {$theme.green} - ((0..<$env.SHLVL | each {">"} | str join) | color $indicator_color) + " " -} -$env.PROMPT_VI_NORMAL_INDICATOR = {|| - let indicator_color = if $env.LAST_EXIT_CODE > 0 {$theme.red} else {$theme.green} - ((0..<$env.SHLVL | each {"="} | str join) | color $indicator_color) + " " -} -$env.PROMPT_VI_INSERT_INDICATOR = {|| - let indicator_color = if $env.LAST_EXIT_CODE > 0 {$theme.red} else {$theme.green} - ((0..<$env.SHLVL | each {"<"} | str join) | color $indicator_color) + " " -} -$env.PROMPT_MULTILINE_INDICATOR = {|| - 0..$env.SHLVL | each {char space} | str join -} -$env.TRANSIENT_PROMPT_COMMAND = "" -$env.TRANSIENT_PROMPT_COMMAND_RIGHT = "" -$env.TRANSIENT_PROMPT_INDICATOR = null -$env.TRANSIENT_PROMPT_VI_NORMAL_INDICATOR = null -$env.TRANSIENT_PROMPT_VI_INSERT_INDICATOR = null -$env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = null - $env.EDITOR = "hx" $env.SHELL = "nu"