From d92f5315ea1847cb46baf8d953b6d8aeae50192f Mon Sep 17 00:00:00 2001 From: cswimr Date: Mon, 18 Nov 2024 16:50:13 -0500 Subject: [PATCH] migrate to `starship` instead of `oh-my-zsh` --- nixos/zsh.nix | 76 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/nixos/zsh.nix b/nixos/zsh.nix index 9e0b1af..e7c7f27 100755 --- a/nixos/zsh.nix +++ b/nixos/zsh.nix @@ -1,16 +1,62 @@ { pkgs, ... }: { - # starship - an customizable prompt for any shell - #programs.starship = { - #enable = true; - # custom settings - #settings = { - #format = "$all$nix_shell$python$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status\n$username$hostname$directory"; - #add_newline = true; - #aws.disabled = true; - #gcloud.disabled = true; - #line_break.disabled = true; - #}; - #}; + # starship - a customizable prompt for any shell + programs.starship = { + enable = true; + # custom settings + settings = { + format = + "[](bg:#1e1e2e fg:#a6e3a1)$username$hostname[](fg:#a6e3a1 bg:#89b4fa)$directory[](fg:#89b4fa bg:#cba6f7)$direnv[](fg:#cba6f7 bg:#f9e2af)$git_branch$git_status[](fg:#f9e2af bg:#1e1e2e)$character"; + username = { + show_always = true; + format = "[ $user@]($style)"; + style_user = "fg:#313244 bg:#a6e3a1"; + style_root = "fg:#313244 bg:#a6e3a1"; + }; + hostname = { + ssh_only = false; + format = "[$hostname $ssh_symbol]($style)"; + style = "fg:#313244 bg:#a6e3a1"; + }; + directory = { + format = "[ $path ]($style)"; + style = "fg:#313244 bg:#89b4fa"; + }; + git_branch = { + format = "[ $symbol$branch(:$remote_branch) ]($style)"; + symbol = "  "; + style = "fg:#313244 bg:#f9e2af"; + }; + direnv = { + symbol = "󱄅 "; + format = "[ $symbol$loaded/$allowed ]($style)"; + disabled = false; + style = "fg:#313244 bg:#cba6f7"; + }; + git_status = { + format = "[$all_status]($style)"; + style = "fg:#313244 bg:#f9e2af"; + }; + git_metrics = { + format = "([+$added]($added_style))[]($added_style)"; + added_style = "fg:#313244 bg:#f9e2af"; + deleted_style = "fg:bright-red bg:235"; + disabled = false; + }; + hg_branch = { + format = "[ $symbol$branch ]($style)"; + symbol = " "; + }; + cmd_duration = { + format = "[  $duration ]($style)"; + style = "fg:bright-white bg:18"; + }; + character = { + success_symbol = "[ ](#a6e3a1) "; + error_symbol = "[ ✗](#f38ba8) "; + }; + }; + + }; users.defaultUserShell = pkgs.zsh; programs.zsh = { enable = true; @@ -25,12 +71,6 @@ histSize = 10000; histFile = "$HOME/.zsh_history"; - ohMyZsh = { - enable = true; - theme = "agnoster"; - plugins = [ "git" "direnv"]; - }; - shellAliases = let ezaArgs = "--time-style='+%Y-%m-%d %H:%M' --icons"; in { ff = "fastfetch";