diff options
Diffstat (limited to 'common/commandline')
-rw-r--r-- | common/commandline/starship.nix | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/common/commandline/starship.nix b/common/commandline/starship.nix index 5983d2e..a17f9e8 100644 --- a/common/commandline/starship.nix +++ b/common/commandline/starship.nix | |||
@@ -1,4 +1,8 @@ | |||
1 | inputs: {lib, ...}: { | 1 | _inputs: |
2 | { lib, pkgs, ... }: | ||
3 | { | ||
4 | users.extraUsers.minijackson.packages = [ pkgs.sd ]; | ||
5 | |||
2 | home-manager.users.minijackson = { | 6 | home-manager.users.minijackson = { |
3 | programs.starship = { | 7 | programs.starship = { |
4 | enable = true; | 8 | enable = true; |
@@ -18,6 +22,45 @@ inputs: {lib, ...}: { | |||
18 | nix_shell.style = "bold blue"; | 22 | nix_shell.style = "bold blue"; |
19 | package.style = "bold green"; | 23 | package.style = "bold green"; |
20 | rust.style = "bold dimmed yellow"; | 24 | rust.style = "bold dimmed yellow"; |
25 | |||
26 | custom = { | ||
27 | jj = { | ||
28 | command = '' | ||
29 | jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' | ||
30 | separate(" ", | ||
31 | bookmarks.map(|x| if( | ||
32 | x.name().substr(0, 10).starts_with(x.name()), | ||
33 | x.name().substr(0, 10), | ||
34 | x.name().substr(0, 9) ++ "…") | ||
35 | ).join(" "), | ||
36 | tags.map(|x| if( | ||
37 | x.name().substr(0, 10).starts_with(x.name()), | ||
38 | x.name().substr(0, 10), | ||
39 | x.name().substr(0, 9) ++ "…") | ||
40 | ).join(" "), | ||
41 | surround("\"","\"", | ||
42 | if( | ||
43 | description.first_line().substr(0, 24).starts_with(description.first_line()), | ||
44 | description.first_line().substr(0, 24), | ||
45 | description.first_line().substr(0, 23) ++ "…" | ||
46 | ) | ||
47 | ), | ||
48 | if(conflict, "conflict"), | ||
49 | if(divergent, "divergent"), | ||
50 | if(hidden, "hidden"), | ||
51 | ) | ||
52 | ' | ||
53 | ''; | ||
54 | detect_folders = [ ".jj" ]; | ||
55 | symbol = "jj "; | ||
56 | }; | ||
57 | jjstate = { | ||
58 | 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." "" | ||
60 | ''; | ||
61 | detect_folders = [ ".jj" ]; | ||
62 | }; | ||
63 | }; | ||
21 | } | 64 | } |
22 | 65 | ||
23 | (lib.importTOML ./starship-plain-text-symbols.toml) | 66 | (lib.importTOML ./starship-plain-text-symbols.toml) |