]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/starship.nix
git: ignore formatting with nixfmt-rfc-style
[julm/julm-nix.git] / home-manager / profiles / starship.nix
1 {
2 pkgs,
3 lib,
4 config,
5 ...
6 }:
7 {
8 programs.starship = {
9 enable = true;
10 enableBashIntegration = config.programs.bash.enable;
11 # DOC: https://starship.rs/config/
12 settings = {
13 add_newline = false;
14 command_timeout = 100;
15 continuation_prompt = "[↳](bright-black) ";
16 format = "$username$hostname$localip$shlvl$git_branch$git_commit$git_state$git_metrics$git_status$c$container$ocaml$purescript$nix_shell$haskell$memory_usage$sudo$cmd_duration$time$line_break$jobs$battery$directory$status$character";
17 right_format = "";
18 scan_timeout = 30;
19
20 battery = {
21 format = "[$symbol$percentage]($style) ";
22 charging_symbol = " ";
23 discharging_symbol = " ";
24 empty_symbol = " ";
25 full_symbol = " ";
26 unknown_symbol = " ";
27 disabled = false;
28 display = [
29 {
30 style = "red bold";
31 threshold = 50;
32 }
33 ];
34 };
35 character = {
36 format = "$symbol ";
37 vicmd_symbol = "[❮](bold green)";
38 disabled = false;
39 success_symbol = "[➜](bold green)";
40 error_symbol = "[✗](bold red)";
41 };
42 cmd_duration = {
43 min_time = 2000;
44 format = "[($duration )]($style)";
45 style = "bright-black bold";
46 show_milliseconds = false;
47 disabled = false;
48 show_notifications = false;
49 min_time_to_notify = 45000;
50 };
51 container = {
52 format = "[$symbol [$name]]($style) ";
53 symbol = "⬢";
54 style = "red bold dimmed";
55 disabled = false;
56 };
57 directory = {
58 disabled = false;
59 fish_style_pwd_dir_length = 0;
60 format = "[$path]($style)[$read_only]($read_only_style) ";
61 home_symbol = "~";
62 #before_repo_root_style = "bold gray";
63 #repo_root_style = "bold cyan";
64 read_only = " RO";
65 #read_only_style = "orange";
66 #repo_root_format = "[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) ";
67 style = "bold green";
68 truncate_to_repo = true;
69 truncation_length = 3;
70 truncation_symbol = "…/";
71 use_logical_path = true;
72 use_os_path_sep = true;
73 };
74 directory.substitutions = {
75 ## Here is how you can shorten some long paths by text replacement;
76 ## similar to mapped_locations in Oh My Posh:;
77 #"Documents" = " ";
78 #"Downloads" = " ";
79 #"Music" = " ";
80 #"Pictures" = " ";
81 ## Keep in mind that the order matters. For example:;
82 ## "Important Documents" = "  ";
83 ## will not be replaced, because "Documents" was already substituted before.;
84 ## So either put "Important Documents" before "Documents" or use the substituted version:;
85 ## "Important  " = "  ";
86 #"Important " = " ";
87 };
88 env_var = { };
89 env_var.SHELL = {
90 format = "[$symbol($env_value )]($style)";
91 style = "bright-black bold italic dimmed";
92 symbol = "e:";
93 disabled = true;
94 variable = "SHELL";
95 default = "unknown shell";
96 };
97 env_var.USER = {
98 format = "[$symbol($env_value )]($style)";
99 style = "bright-black bold italic dimmed";
100 symbol = "e:";
101 disabled = true;
102 default = "unknown user";
103 };
104 fill = {
105 style = "bold black";
106 symbol = " ";
107 disabled = false;
108 };
109 git_branch = {
110 format = "[$symbol$branch(:$remote_branch)]($style) ";
111 symbol = " ";
112 style = "bold purple bg:0xFCA17D";
113 truncation_length = 9223372036854775807;
114 truncation_symbol = "…";
115 only_attached = false;
116 always_show_remote = false;
117 ignore_branches = [ ];
118 disabled = false;
119 };
120 git_commit = {
121 commit_hash_length = 7;
122 format = "[($hash$tag)]($style) ";
123 style = "green bold";
124 only_detached = true;
125 disabled = false;
126 tag_symbol = " 🏷 ";
127 tag_disabled = true;
128 };
129 git_metrics = {
130 added_style = "bold green";
131 deleted_style = "bold red";
132 only_nonzero_diffs = true;
133 format = "([+$added]($added_style) )([-$deleted]($deleted_style) )";
134 disabled = false;
135 };
136 git_state = {
137 am = "AM";
138 am_or_rebase = "AM/REBASE";
139 bisect = "BISECTING";
140 cherry_pick = "🍒PICKING(bold red)";
141 disabled = false;
142 format = "([$state( $progress_current/$progress_total)]($style)) ";
143 merge = "MERGING";
144 rebase = "REBASING";
145 revert = "REVERTING";
146 style = "bold yellow";
147 };
148 git_status = {
149 format = "([$all_status( $ahead_behind)]($style) )";
150 style = "purple bold";
151 ahead = "⇡\${count}";
152 diverged = "⇡\${ahead_count}⇣\${behind_count}";
153 behind = "⇣\${count}";
154 /*
155 ahead = "🏎💨$count";
156 behind = "😰$count";
157 conflicted = "🏳";
158 deleted = "🗑";
159 disabled = false;
160 diverged = "😵";
161 format = "([$all_status$ahead_behind]($style) )";
162 ignore_submodules = false;
163 modified = "📝";
164 renamed = "👅";
165 staged = "[++($count)](green)";
166 stashed = "📦";
167 style = "red bold bg:0xFCA17D";
168 untracked = "🤷";
169 up_to_date = "✓";
170 */
171 };
172 haskell = {
173 format = "[$symbol($version )]($style)";
174 version_format = "v$raw";
175 symbol = "λ ";
176 style = "yellow bold";
177 disabled = false;
178 detect_extensions = [
179 "hs"
180 "lhs"
181 "cabal"
182 "hs-boot"
183 ];
184 detect_files = [
185 "stack.yaml"
186 "cabal.project"
187 ];
188 detect_folders = [ ];
189 };
190 hostname = {
191 disabled = false;
192 format = "[$hostname]($style) ";
193 ssh_only = true;
194 style = "red dimmed bold";
195 trim_at = ".";
196 };
197 jobs = {
198 threshold = 1;
199 symbol_threshold = 1;
200 number_threshold = 1;
201 format = "[$symbol$number]($style) ";
202 symbol = "&";
203 style = "yellow bold";
204 disabled = false;
205 };
206 line_break = {
207 disabled = false;
208 };
209 localip = {
210 disabled = true;
211 format = "[@$localipv4]($style) ";
212 ssh_only = false;
213 style = "yellow bold";
214 };
215 memory_usage = {
216 disabled = true;
217 format = "$symbol[$ram( | $swap)]($style) ";
218 style = "white bold dimmed";
219 symbol = " ";
220 # threshold = 75;
221 threshold = -1;
222 };
223 nix_shell = {
224 format = "[$symbol]($style) ";
225 #format = "[$symbol$state( \\($name\\))]($style)";
226 disabled = false;
227 impure_msg = "";
228 #impure_msg = "[impure](bold red)";
229 pure_msg = "[pure](bold green)";
230 style = "bold blue";
231 symbol = "❄️";
232 #heuristic = true;
233 };
234 ocaml = {
235 format = "[$symbol($version )(($switch_indicator$switch_name) )]($style)";
236 global_switch_indicator = "";
237 local_switch_indicator = "*";
238 style = "bold yellow";
239 symbol = "🐫 ";
240 version_format = "v$raw";
241 disabled = true;
242 detect_extensions = [
243 "opam"
244 "ml"
245 "mli"
246 "re"
247 "rei"
248 ];
249 detect_files = [
250 "dune"
251 "dune-project"
252 "jbuild"
253 "jbuild-ignore"
254 ".merlin"
255 ];
256 detect_folders = [
257 "_opam"
258 "esy.lock"
259 ];
260 };
261 purescript = {
262 format = "[$symbol($version )]($style)";
263 version_format = "v$raw";
264 symbol = "<=> ";
265 style = "bold white";
266 disabled = true;
267 detect_extensions = [ "purs" ];
268 detect_files = [ "spago.dhall" ];
269 detect_folders = [ ];
270 };
271 rlang = {
272 format = "[$symbol($version )]($style)";
273 version_format = "v$raw";
274 style = "blue bold";
275 symbol = "📐 ";
276 disabled = true;
277 detect_extensions = [
278 "R"
279 "Rd"
280 "Rmd"
281 "Rproj"
282 "Rsx"
283 ];
284 detect_files = [ ".Rprofile" ];
285 detect_folders = [ ".Rproj.user" ];
286 };
287 shlvl = {
288 threshold = 2;
289 format = "[$symbol$shlvl]($style) ";
290 symbol = "↕️ ";
291 repeat = false;
292 style = "bold yellow";
293 disabled = true;
294 };
295 status = {
296 format = "[$symbol$status]($style) ";
297 map_symbol = true;
298 not_executable_symbol = "🚫";
299 not_found_symbol = "🔍";
300 pipestatus = false;
301 pipestatus_format = "[$pipestatus] => [$symbol$common_meaning$signal_name$maybe_int]($style)";
302 pipestatus_separator = "|";
303 recognize_signal_code = true;
304 signal_symbol = "⚡";
305 style = "bold red bg:blue";
306 success_symbol = "🟢 SUCCESS";
307 symbol = "🔴 ";
308 disabled = true;
309 };
310 sudo = {
311 format = "[as $symbol]($style)";
312 symbol = "🧙 ";
313 style = "bold blue";
314 allow_windows = false;
315 disabled = true;
316 };
317 time = {
318 format = "[\\[$time\\]]($style)";
319 style = "bright-black bold";
320 use_12hr = false;
321 disabled = false;
322 utc_time_offset = "local";
323 # time_format = "%R"; # Hour:Minute Format;
324 time_format = "%T"; # Hour:Minute:Seconds Format;
325 time_range = "-";
326 };
327 username = {
328 format = "[$user]($style) ";
329 show_always = true;
330 style_root = "red bold bg:0x9A348E";
331 style_user = "bright-black bold bg:0x9A348E";
332 disabled = false;
333 };
334 custom = { };
335 };
336 };
337 programs.bash = {
338 initExtra = ''
339 function set_win_title(){
340 echo -ne "\033]0;Term: $USER@$HOSTNAME: $PWD\007"
341 }
342 starship_precmd_user_func="set_win_title"
343 '';
344 };
345 }