prompt.nix (4969B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | ## Shell Prompt Configuration ## _: { flake.modules.nixos.prompt = {config, ...}: { programs.starship = let open = ""; close = ""; char = "⮞"; build = a: b: c: build' { icon = a; var = b; color = c; }; build' = { icon, var, color, style ? "fg:white", end ? "[${close}](fg:base03)", ... }: "[─](fg:base04)[${open}](fg:${color})[${icon}](fg:base01 bg:${color})[${close}](fg:${color} bg:base03)[ ${var}](${style} bg:base03)${end}"; in { enable = true; settings = { add_newline = true; continuation_prompt = "${char} "; format = "[╭](fg:base04)$os$directory$git_branch$git_status$fill$c$python$java$nodejs$dotnet$status$cmd_duration$shell$username$hostname$time$line_break$character"; character = { format = "[╰─$symbol](fg:base04) "; success_symbol = "[${char}](fg:bold white)"; error_symbol = "[${char}](fg:bold red)"; }; os = { disabled = false; format = "(fg:base04)[${open}](fg:white)[$symbol](fg:base01 bg:white)[${close}](fg:white)"; symbols = { Android = ""; Arch = ""; Fedora = ""; Linux = ""; Macos = ""; NixOS = ""; Ubuntu = ""; Windows = ""; Unknown = ""; }; }; directory = { disabled = false; format = build "" "$read_only$truncation_symbol$path" "blue"; home_symbol = "~"; truncation_symbol = "…/"; truncation_length = 4; truncate_to_repo = false; read_only = ""; }; git_branch = { disabled = false; format = build' { icon = ""; var = "$branch"; color = "green"; end = ""; }; }; git_status = { disabled = false; format = "[$ahead_behind$all_status](fg:green bg:base03)[${close}](fg:base03)"; ahead = " ⇡$count"; behind = " ⇣$count"; diverged = " ⇡$ahead_count ⇣$behind_count"; conflicted = " =$count"; deleted = " ×$count"; modified = " !$count"; renamed = " »$count"; staged = " +$count"; stashed = " *$count"; untracked = " ?$count"; up_to_date = ""; }; c.format = build " C" "$version" "bright-white"; python.format = build " Python" "$version" "bright-white"; java.format = build " Java" "$version" "bright-white"; nodejs.format = build " Node.js" "$version" "bright-white"; dotnet.format = build " .NET" "$version" "bright-white"; fill = { symbol = "─"; style = "fg:base04"; }; status = { disabled = false; format = build "" "$status" "red"; }; cmd_duration = { min_time = 500; format = build "" "$duration" "orange"; }; shell = { disabled = false; format = build "" "$indicator" "purple"; bash_indicator = "bash"; fish_indicator = "fish"; zsh_indicator = "zsh"; unknown_indicator = "shell"; }; username = { show_always = true; style_user = "fg:white"; style_root = "bold fg:red"; format = build' { icon = ""; var = "$user"; color = "yellow"; style = "$style"; }; }; hostname = { disabled = false; format = build "" "$hostname" "cyan"; ssh_only = false; }; time = { disabled = false; format = build "" "$time" "blue"; time_format = "%H:%M"; }; palette = "base16"; palettes.base16 = with config.lib.stylix.colors.withHashtag; { black = base00; bright-black = base03; white = base05; bright-white = base07; purple = magenta; bright-purple = bright-magenta; inherit blue brown cyan green magenta orange red yellow bright-blue bright-cyan bright-green bright-magenta bright-red bright-yellow base00 base01 base02 base03 base04 base05 base06 base07 base08 base09 base0A base0B base0C base0D base0E base0F ; }; }; }; }; } |