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
|
diff --git a/home/nogui/oh-my-posh.nix b/home/nogui/oh-my-posh.nix
index 91c69b51f9e5e87e47eed514ef59375b79cae3ad..c051ddcb8b18cd1b7b88259f23716525f53966ec 100644
--- a/home/nogui/oh-my-posh.nix
+++ b/home/nogui/oh-my-posh.nix
@@ -1,46 +1,6 @@
{ pkgs, ... }:
let
unicode = x: builtins.fromJSON ''"${x}"'';
- jjScript = pkgs.writeShellApplication {
- name = "jj-prompt";
- runtimeInputs = [ pkgs.jujutsu ];
- text =
- let
- bookmarkMax = 10;
- tagMax = 10;
- descriptionMax = 24;
- in
- ''
- jj log -r@ -n1 --ignore-working-copy --no-graph --color never -T '
- separate(" ",
- bookmarks.map(|x| if(
- x.name().substr(0, ${builtins.toString bookmarkMax}).starts_with(x.name()),
- " " ++ x.name().substr(0, ${builtins.toString bookmarkMax}),
- " " ++ x.name().substr(0, ${builtins.toString (bookmarkMax - 1)}) ++ "…")
- ).join(" "),
- tags.map(|x| if(
- x.name().substr(0, ${builtins.toString tagMax}).starts_with(x.name()),
- " " ++ x.name().substr(0, ${builtins.toString tagMax}),
- " " ++ x.name().substr(0, ${builtins.toString (tagMax - 1)}) ++ "…")
- ).join(" "),
- if(
- description.first_line().substr(0, ${builtins.toString descriptionMax}).starts_with(description.first_line()),
- " " ++ description.first_line().substr(0, ${builtins.toString descriptionMax}),
- " " ++ description.first_line().substr(0, ${
- builtins.toString (descriptionMax - 1)
- }) ++ "…"
- ),
- "•",
- change_id.shortest(6).prefix() ++ "(" ++ change_id.shortest(6).rest() ++ ")",
- if(empty, "(empty)"),
- if(conflict, "(conflict)"),
- if(divergent, "(divergent)"),
- if(hidden, "(hidden)"),
- if(immutable, "🔒"),
- )
- '
- '';
- };
gitBugScript = pkgs.writeShellApplication {
name = "git-bug-prompt";
runtimeInputs = [
@@ -111,21 +71,23 @@ "codeberg.org" = unicode "\\ue2a6";
"git.jojodev.com" = unicode "\\udb83\\udd9e";
"gitea.com" = unicode "\\udb83\\udd9e";
};
+ disable_with_jj = true;
};
style = "powerline";
- template = "{{ if not (glob \".jj\")}} {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} ${unicode "\\uf044"} {{ .Working.String }}{{ end }}{{ if .Staging.Changed }} ${unicode "\\uf046"} {{ .Staging.String }}{{ end }} {{ end }}";
type = "git";
}
{
- background = "p:green";
+ type = "jujutsu";
+ style = "powerline";
+ powerline_symbol = "";
foreground = "p:black";
- powerline_symbol = unicode "\\ue0b0";
- properties = {
- script = "${jjScript}/bin/jj-prompt";
+ background = "p:green";
+ options = {
+ fetch_status = true;
+ ignore_working_copy = false;
+ fetch_ahead_counter = true;
+ ahead_icon = "⇡";
};
- style = "powerline";
- template = "{{ if (glob \".jj\")}} {{ .Output }} {{ end }}";
- type = "command";
}
{
background = "p:maroon";
|