diff options
Diffstat (limited to 'common/commandline')
-rw-r--r-- | common/commandline/starship.nix | 123 |
1 files changed, 65 insertions, 58 deletions
diff --git a/common/commandline/starship.nix b/common/commandline/starship.nix index a17f9e8..98b6e36 100644 --- a/common/commandline/starship.nix +++ b/common/commandline/starship.nix | |||
@@ -3,68 +3,75 @@ _inputs: | |||
3 | { | 3 | { |
4 | users.extraUsers.minijackson.packages = [ pkgs.sd ]; | 4 | users.extraUsers.minijackson.packages = [ pkgs.sd ]; |
5 | 5 | ||
6 | home-manager.users.minijackson = { | 6 | home-manager.sharedModules = [ |
7 | programs.starship = { | 7 | { |
8 | enable = true; | 8 | programs.starship = { |
9 | enableZshIntegration = true; | 9 | enable = true; |
10 | enableZshIntegration = true; | ||
10 | 11 | ||
11 | settings = lib.mkMerge [ | 12 | settings = lib.mkMerge [ |
12 | { | 13 | { |
13 | directory = { | 14 | directory = { |
14 | fish_style_pwd_dir_length = 2; | 15 | fish_style_pwd_dir_length = 2; |
15 | repo_root_style = "bold cyan"; | 16 | repo_root_style = "bold cyan"; |
16 | style = "bold white"; | 17 | style = "bold white"; |
17 | truncate_to_repo = false; | 18 | truncate_to_repo = false; |
18 | }; | 19 | }; |
20 | |||
21 | hostname = { | ||
22 | ssh_symbol = "ssh "; | ||
23 | style = "bold blue"; | ||
24 | }; | ||
19 | 25 | ||
20 | jobs.symbol = "+ "; | 26 | jobs.symbol = "+ "; |
21 | 27 | ||
22 | nix_shell.style = "bold blue"; | 28 | nix_shell.style = "bold blue"; |
23 | package.style = "bold green"; | 29 | package.style = "bold green"; |
24 | rust.style = "bold dimmed yellow"; | 30 | rust.style = "bold dimmed yellow"; |
25 | 31 | ||
26 | custom = { | 32 | custom = { |
27 | jj = { | 33 | jj = { |
28 | command = '' | 34 | command = '' |
29 | jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' | 35 | jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' |
30 | separate(" ", | 36 | separate(" ", |
31 | bookmarks.map(|x| if( | 37 | bookmarks.map(|x| if( |
32 | x.name().substr(0, 10).starts_with(x.name()), | 38 | x.name().substr(0, 10).starts_with(x.name()), |
33 | x.name().substr(0, 10), | 39 | x.name().substr(0, 10), |
34 | x.name().substr(0, 9) ++ "…") | 40 | x.name().substr(0, 9) ++ "…") |
35 | ).join(" "), | 41 | ).join(" "), |
36 | tags.map(|x| if( | 42 | tags.map(|x| if( |
37 | x.name().substr(0, 10).starts_with(x.name()), | 43 | x.name().substr(0, 10).starts_with(x.name()), |
38 | x.name().substr(0, 10), | 44 | x.name().substr(0, 10), |
39 | x.name().substr(0, 9) ++ "…") | 45 | x.name().substr(0, 9) ++ "…") |
40 | ).join(" "), | 46 | ).join(" "), |
41 | surround("\"","\"", | 47 | surround("\"","\"", |
42 | if( | 48 | if( |
43 | description.first_line().substr(0, 24).starts_with(description.first_line()), | 49 | description.first_line().substr(0, 24).starts_with(description.first_line()), |
44 | description.first_line().substr(0, 24), | 50 | description.first_line().substr(0, 24), |
45 | description.first_line().substr(0, 23) ++ "…" | 51 | description.first_line().substr(0, 23) ++ "…" |
46 | ) | 52 | ) |
47 | ), | 53 | ), |
48 | if(conflict, "conflict"), | 54 | if(conflict, "conflict"), |
49 | if(divergent, "divergent"), | 55 | if(divergent, "divergent"), |
50 | if(hidden, "hidden"), | 56 | if(hidden, "hidden"), |
51 | ) | 57 | ) |
52 | ' | 58 | ' |
53 | ''; | 59 | ''; |
54 | detect_folders = [ ".jj" ]; | 60 | detect_folders = [ ".jj" ]; |
55 | symbol = "jj "; | 61 | symbol = "jj "; |
56 | }; | 62 | }; |
57 | jjstate = { | 63 | jjstate = { |
58 | command = '' | 64 | command = '' |
59 | jj log -r@ -n1 --no-graph -T "" --stat | tail -n1 | sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | sd " 0." "" | 65 | jj log -r@ -n1 --no-graph -T "" --stat | tail -n1 | sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | sd " 0." "" |
60 | ''; | 66 | ''; |
61 | detect_folders = [ ".jj" ]; | 67 | detect_folders = [ ".jj" ]; |
68 | }; | ||
62 | }; | 69 | }; |
63 | }; | 70 | } |
64 | } | ||
65 | 71 | ||
66 | (lib.importTOML ./starship-plain-text-symbols.toml) | 72 | (lib.importTOML ./starship-plain-text-symbols.toml) |
67 | ]; | 73 | ]; |
68 | }; | 74 | }; |
69 | }; | 75 | } |
76 | ]; | ||
70 | } | 77 | } |