Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / home / nogui / jj.nix
- raw -
 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
84
85
86
87
88
89
90
{ pkgs, jolheiser, ... }:
{
  programs.jujutsu = {
    enable = true;
    settings = {
      user = {
        name = jolheiser.git.username;
        email = jolheiser.git.email;
      };
      ui = {
        diff-formatter = [
          "${pkgs.difftastic}/bin/difft"
          "--color=always"
          "$left"
          "$right"
        ];
        editor = "hx";
        paginate = "never";
        default-command = "status";
        show-cryptographic-signatures = true;
      };
      templates = {
        git_push_bookmark = ''"change/" ++ change_id.short()'';
        draft_commit_description = ''
          concat(
            coalesce(description, default_commit_description, "\n"),
            surround(
              "\nJJ: This commit contains the following changes:\n", "",
              indent("JJ:     ", diff.stat(72)),
            ),
            "\nJJ: ignore-rest\n",
            diff.git(),
          )
        '';
      };
      template-aliases = {
        "format_timestamp(timestamp)" = "timestamp.ago()";
      };
      signing = {
        behavior = "own";
        backend = "ssh";
        key = jolheiser.git.sshKey;
        backends.ssh.allowed-signers = "${pkgs.writeText "allowedSigners" "${jolheiser.git.email} ${jolheiser.git.sshKey}"}";
      };
      revsets.log = "ancestors(present(@), 5) | ancestors(immutable_heads().., 2) | present(trunk())";
      revset-aliases = {
        "closest_bookmark(to)" = "heads(::to & bookmarks())";
        "immutable_heads()" = "builtin_immutable_heads() & remote_bookmarks()";
      };
      aliases = {
        push = [
          "util"
          "exec"
          "git"
          "push"
          "origin"
          "main"
        ];
        fetch = [
          "util"
          "exec"
          "git"
          "fetch"
          "origin"
        ];
        i = [
          "git"
          "init"
          "--colocate"
        ];
        tug = [
          "bookmark"
          "move"
          "--from"
          "closest_bookmark(@-)"
          "--to"
          "@-"
        ];
        ci = [
          "util"
          "exec"
          "--"
          "sh"
          "-c"
          "jj desc && jj new && jj tug"
        ];
      };
    };
  };
}