Vic's *Nix config.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 182 lines 4.2 kB view raw
1# See https://github.com/jj-vcs/jj/discussions/5812 2{ vic, ... }: 3let 4 jj-settings = 5 { pkgs }: 6 { 7 user.name = "Victor Borja"; 8 user.email = "vborja@apache.org"; 9 revsets.log = "default()"; 10 revset-aliases = { 11 "trunk()" = "main@origin"; 12 "compared_to_trunk()" = "(trunk()..@):: | (trunk()..@)-"; 13 "immutable_heads()" = "builtin_immutable_heads() | remote_bookmarks()"; 14 "closest_bookmark(to)" = "heads(::to & bookmarks())"; 15 "default_log()" = "present(@) | ancestors(immutable_heads().., 2) | present(trunk())"; 16 "default()" = "coalesce(trunk(),root())::present(@) | ancestors(visible_heads() & recent(), 2)"; 17 "recent()" = "committer_date(after:'1 week ago')"; 18 }; 19 template-aliases = { 20 "format_short_id(id)" = "id.shortest().upper()"; 21 "format_short_change_id(id)" = "format_short_id(id)"; 22 "format_short_signature(signature)" = "signature.email()"; 23 "format_timestamp(timestamp)" = "timestamp.ago()"; 24 }; 25 "--scope" = jj-scopes { inherit pkgs; }; 26 ui = jj-ui { inherit pkgs; }; 27 signing = { 28 behaviour = "own"; 29 backend = "ssh"; 30 key = "~/.ssh/id_ed25519.pub"; 31 }; 32 aliases = jj-aliases; 33 }; 34 35 jj-diff-formatter = 36 { pkgs }: 37 [ 38 (pkgs.lib.getExe pkgs.delta) 39 "$left" 40 "$right" 41 ]; 42 43 jj-ui = 44 { pkgs }: 45 { 46 default-command = [ 47 "status" 48 "--no-pager" 49 ]; 50 diff-formatter = jj-diff-formatter { inherit pkgs; }; 51 diff-editor = [ 52 "nvim" 53 "-c" 54 "DiffEditor $left $right $output" 55 ]; 56 conflict-marker-style = "git"; 57 movement.edit = false; 58 }; 59 60 jj-scopes = 61 { pkgs }: 62 [ 63 { 64 "--when".commands = [ 65 "diff" 66 "show" 67 ]; 68 ui.pager = (pkgs.lib.getExe pkgs.delta); 69 ui.diff-formatter = jj-diff-formatter { inherit pkgs; }; 70 } 71 { 72 "--when".repositories = [ "~/hk/jjui" ]; 73 revsets.log = "default()"; 74 revset-aliases = { 75 "trunk()" = "main@idursun"; 76 "vic" = "remote_bookmarks('', 'vic')"; 77 "idursun" = "remote_bookmarks('', 'idursun')"; 78 "default()" = 79 "coalesce( trunk(), root() )::present(@) | ancestors(visible_heads() & recent(), 2) | idursun | vic"; 80 }; 81 aliases.n = [ 82 "new" 83 "main@idursun" 84 ]; 85 } 86 ]; 87 88 jj-aliases = { 89 tug = [ 90 "bookmark" 91 "move" 92 "--from" 93 "closest_bookmark(@-)" 94 "--to" 95 "@-" 96 ]; 97 lr = [ 98 "log" 99 "-r" 100 "default() & recent()" 101 ]; 102 s = [ "show" ]; 103 sq = [ 104 "squash" 105 "-i" 106 ]; 107 sU = [ 108 "squash" 109 "-i" 110 "-f" 111 "@+" 112 "-t" 113 "@" 114 ]; 115 su = [ 116 "squash" 117 "-i" 118 "-f" 119 "@" 120 "-t" 121 "@+" 122 ]; 123 sd = [ 124 "squash" 125 "-i" 126 "-f" 127 "@" 128 "-t" 129 "@-" 130 ]; 131 sD = [ 132 "squash" 133 "-i" 134 "-f" 135 "@-" 136 "-t" 137 "@" 138 ]; 139 l = [ 140 "log" 141 "-r" 142 "compared_to_trunk()" 143 "--config" 144 "template-aliases.'format_short_id(id)'='id.shortest().upper()'" 145 "--config" 146 "template-aliases.'format_short_change_id(id)'='id.shortest().upper()'" 147 "--config" 148 "template-aliases.'format_timestamp(timestamp)'='timestamp.ago()'" 149 ]; 150 ll = [ 151 "log" 152 "-r" 153 ".." 154 ]; 155 }; 156in 157{ 158 flake-file.inputs.jjui.url = "github:idursun/jjui"; 159 160 vic.everywhere.includes = [ vic.jujutsu ]; 161 vic.jujutsu.homeManager = 162 { pkgs, inputs', ... }: 163 let 164 jjui = inputs'.jjui.packages.jjui; 165 jjui-wrapped = pkgs.writeShellApplication { 166 name = "jjui"; 167 text = '' 168 # ask for password if key is not loaded, before jjui 169 ssh-add -l || ssh-add 170 ${pkgs.lib.getExe jjui} "$@" 171 ''; 172 }; 173 in 174 { 175 home.packages = [ jjui-wrapped ]; 176 programs.jujutsu = { 177 enable = true; 178 settings = jj-settings { inherit pkgs; }; 179 }; 180 # home.file.".config/jjui/config.toml".source = fmt.generate "config.toml" jjui-toml; 181 }; 182}