From b333a4f693b0be6c6d97ea6774af31875151ef1f Mon Sep 17 00:00:00 2001 From: Thomas Syms Date: Tue, 5 Nov 2024 17:36:01 -0400 Subject: [PATCH] Fixed system for nushell --- home/shell/autojump.nix | 5 - home/shell/common.nix | 3 + home/shell/default.nix | 1 - home/shell/git.nix | 3 + home/shell/nushell/default.nix | 9 +- home/shell/starship/theme.toml | 208 +++++++++++++++++++++++++-------- home/shell/zoxide.nix | 6 +- modules/system.nix | 2 +- 8 files changed, 176 insertions(+), 61 deletions(-) delete mode 100644 home/shell/autojump.nix diff --git a/home/shell/autojump.nix b/home/shell/autojump.nix deleted file mode 100644 index 0c04908..0000000 --- a/home/shell/autojump.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.autojump = { - enable = true; - }; -} diff --git a/home/shell/common.nix b/home/shell/common.nix index 127d43d..8e44131 100644 --- a/home/shell/common.nix +++ b/home/shell/common.nix @@ -2,6 +2,9 @@ home.shellAliases = { sudo = "sudo --preserve-env=PATH"; }; + programs.nushell.shellAliases = { + sudo = "sudo --preserve-env=PATH"; + }; home.packages = with pkgs; [ # AI Tools diff --git a/home/shell/default.nix b/home/shell/default.nix index 70c1c49..1ab6afc 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -2,7 +2,6 @@ imports = [ ./aria2.nix ./atuin.nix - ./autojump.nix ./bat.nix ./bottom.nix ./btop.nix diff --git a/home/shell/git.nix b/home/shell/git.nix index c940164..6f9cfdb 100644 --- a/home/shell/git.nix +++ b/home/shell/git.nix @@ -23,4 +23,7 @@ home.shellAliases = { lgit = "lazygit"; }; + programs.nushell.shellAliases = { + lgit = "lazygit"; + }; } diff --git a/home/shell/nushell/default.nix b/home/shell/nushell/default.nix index c314fa3..b69cb58 100644 --- a/home/shell/nushell/default.nix +++ b/home/shell/nushell/default.nix @@ -1,5 +1,12 @@ -{ +{pkgs, ...}: { programs.nushell = { enable = true; }; + + home.packages = with pkgs; [ + nushellPlugins.query + nushellPlugins.formats + nushellPlugins.gstat + nushellPlugins.net + ]; } diff --git a/home/shell/starship/theme.toml b/home/shell/starship/theme.toml index 9e186d0..a7ed292 100644 --- a/home/shell/starship/theme.toml +++ b/home/shell/starship/theme.toml @@ -1,62 +1,168 @@ -add_newline = false -# A minimal left prompt -format = """$directory$character""" -palette = "catppuccin_mocha" -# move the rest of the prompt to the right -right_format = """$all""" -command_timeout = 1000 +"$schema" = 'https://starship.rs/config-schema.json' + +format = """ +[](color_orange)\ +$username\ +[](bg:color_yellow fg:color_orange)\ +$directory\ +[](fg:color_yellow bg:color_aqua)\ +$git_branch\ +$git_status\ +[](fg:color_aqua bg:color_blue)\ +$c\ +$rust\ +$golang\ +$nodejs\ +$php\ +$java\ +$kotlin\ +$haskell\ +$python\ +[](fg:color_blue bg:color_bg3)\ +$docker_context\ +$conda\ +[](fg:color_bg3 bg:color_bg1)\ +$time\ +[ ](fg:color_bg1)\ +$line_break$character""" + +palette = 'gruvbox_dark' + +[palettes.gruvbox_dark] +color_fg0 = '#fbf1c7' +color_bg1 = '#3c3836' +color_bg3 = '#665c54' +color_blue = '#458588' +color_aqua = '#689d6a' +color_green = '#98971a' +color_orange = '#d65d0e' +color_purple = '#b16286' +color_red = '#cc241d' +color_yellow = '#d79921' + +[os] +disabled = false +style = "bg:color_orange fg:color_fg0" + +[os.symbols] +Windows = "󰍲" +Ubuntu = "󰕈" +SUSE = "" +Raspbian = "󰐿" +Mint = "󰣭" +Macos = "󰀵" +Manjaro = "" +Linux = "󰌽" +Gentoo = "󰣨" +Fedora = "󰣛" +Alpine = "" +Amazon = "" +Android = "" +Arch = "󰣇" +Artix = "󰣇" +EndeavourOS = "" +CentOS = "" +Debian = "󰣚" +Redhat = "󱄛" +RedHatEnterprise = "󱄛" +Pop = "" + +[username] +show_always = true +style_user = "bg:color_orange fg:color_fg0" +style_root = "bg:color_orange fg:color_fg0" +format = '[ $user ]($style)' + +[directory] +style = "fg:color_fg0 bg:color_yellow" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" [directory.substitutions] -'~/tests/starship-custom' = 'work-project' +"Documents" = "󰈙 " +"Downloads" = " " +"Music" = "󰝚 " +"Pictures" = " " +"Developer" = "󰲋 " [git_branch] -format = '[$symbol$branch(:$remote_branch)]($style)' +symbol = "" +style = "bg:color_aqua" +format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)' -[aws] -format = '[$symbol(profile: "$profile" )(\(region: $region\) )]($style)' -disabled = false -style = 'bold blue' -symbol = " " +[git_status] +style = "bg:color_aqua" +format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)' + +[nodejs] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[c] +symbol = " " +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[rust] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' [golang] -format = '[ ](bold cyan)' +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' -[kubernetes] -symbol = '☸ ' -disabled = true -detect_files = ['Dockerfile'] -format = '[$symbol$context( \($namespace\))]($style) ' -contexts = [ - { context_pattern = "arn:aws:eks:us-west-2:577926974532:cluster/zd-pvc-omer", style = "green", context_alias = "omerxx", symbol = " " }, -] +[php] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[java] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[kotlin] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[haskell] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[python] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' [docker_context] -disabled = true +symbol = "" +style = "bg:color_bg3" +format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)' -[palettes.catppuccin_mocha] -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" \ No newline at end of file +[conda] +style = "bg:color_bg3" +format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)' + +[time] +disabled = false +time_format = "%R" +style = "bg:color_bg1" +format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)' + +[line_break] +disabled = false + +[character] +disabled = false +success_symbol = '[](bold fg:color_green)' +error_symbol = '[](bold fg:color_red)' +vimcmd_symbol = '[](bold fg:color_green)' +vimcmd_replace_one_symbol = '[](bold fg:color_purple)' +vimcmd_replace_symbol = '[](bold fg:color_purple)' +vimcmd_visual_symbol = '[](bold fg:color_yellow)' \ No newline at end of file diff --git a/home/shell/zoxide.nix b/home/shell/zoxide.nix index 243ed03..d9fabf8 100644 --- a/home/shell/zoxide.nix +++ b/home/shell/zoxide.nix @@ -4,7 +4,9 @@ }; home.shellAliases = { - zd = "z"; - zdi = "zi"; + j = "z"; + }; + programs.nushell.shellAliases = { + j = "z"; }; } diff --git a/modules/system.nix b/modules/system.nix index bf446cd..4b946e5 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -69,7 +69,7 @@ description = "panotaka"; extraGroups = ["networkmanager" "wheel" "libvirtd"]; initialPassword = "panotaka"; - shell = pkgs.nu; + shell = pkgs.nushell; openssh.authorizedKeys.keys = [ ]; };