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