aboutsummaryrefslogtreecommitdiff
path: root/modules/git.home.nix
blob: e1ba8c915ee0ffcfe3f8cb6c6ac94056fa447686 (plain) (blame)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{ config, pkgs, ... }:
{
  programs.gh = {
    enable = true;
    extensions = with pkgs; [
      gh-copilot
      gh-poi
      # gh-dash
      gh-notify
    ];
    settings = {
      aliases = {
        clean-branches = "poi";
        pv = "pr view";
        co = "pr checkout";
      };
    };
  };

  # programs.gh-dash = {
  #   enable = true;
  #   settings = {
  #     defaults = {
  #       preview = {
  #         open = true;
  #         width = 80;
  #       };
  #     };
  #     pager = { diff = "delta"; };
  #     keybindings = {
  #       prs = [
  #         { key = "m"; command = "echo accident"; }
  #         { key = "x"; command = "echo accident"; }
  #         { key = "a"; command = "echo accident"; }
  #         { key = "A"; command = "echo accident"; }
  #         { key = "W"; command = "echo accident"; }
  #         { key = "X"; command = "echo accident"; }
  #       ];
  #     };
  #   };
  # };

  programs.git = {
    enable = true;
    userEmail = "phenax5@gmail.com";
    userName = "Akshay Nair";
    ignores = [
      "tags"
      ".vim.session"
      "tags.lock"
      "tags.temp"
      "ayak.sh"
      ".direnv"
      ".local.lua"
    ];
    aliases = {
      ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi";
      dshow = "-c diff.external='difft --display side-by-side-show-both' show --ext-diff";
      ddiff = "-c diff.external='difft --display side-by-side-show-both' diff";
    };
    delta = {
      enable = true;
      # package = pkgs.delta;
      options = {
        navigate = true;
        side-by-side = true;
        line-numbers = true;
      };
    };
    # difftastic = {
    #   enable = true;
    #   display = "side-by-side";
    #   color = "auto";
    #   background = "dark";
    # };
    extraConfig = {
      color = {
        ui = true;
      };
      init = {
        defaultBranch = "main";
      };
      "color \"diff-highlight\"" = {
        oldNormal = "red bold";
        oldHighlight = "red bold 52";
        newNormal = "green bold";
        newHighlight = "green bold 22";
      };
      "color \"diff\"" = {
        meta = 11;
        frag = "magenta bold";
        commit = "yellow bold";
        old = "red bold";
        new = "green bold";
        whitespace = "red reverse";
      };
      pull.rebase = true;
      rebase.autosquash = true;
      # pager = {
      #   diff = "${pkgs.delta}/bin/delta --color-only";
      # };
    };
    signing.key = "AAAB13AE8B82A5267C1A35D7E1B701723EA37849";
    signing.signByDefault = true;
  };
}