this repo has no description
1{
2 pkgs,
3 inputs,
4 config,
5 ...
6}: {
7 programs.gh = {
8 enable = true;
9
10 extensions = with pkgs; [
11 gh-dash
12 gh-eco
13 gh-actions-cache
14 ];
15
16 settings.aliases.co = "pr checkout";
17 settings.aliases.patch = "!patch2pr";
18 settings.version = "1";
19 };
20
21 # manual.manpages.enable = true;
22
23 home.packages = [
24 pkgs.git-absorb
25 pkgs.git-branchless
26 pkgs.git-gone
27 pkgs.git-cliff
28 pkgs.git-revise
29 pkgs.gitAndTools.git-imerge
30 pkgs.prr
31 pkgs.hut
32 pkgs.patch2pr
33 inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.imbox
34 ];
35
36 programs.git = {
37 enable = true;
38
39 diff-so-fancy.enable = true;
40 lfs.enable = true;
41
42 attributes = [
43 "*.ex diff=elixir"
44 "*.exs diff=elixir"
45 "mix.lock merge=binary"
46
47 "*.erl diff=erlang"
48 "*.hrl diff=erlang"
49 "rebar.lock merge=binary"
50
51 "*.tex diff=tex"
52
53 "*.rs diff=rust"
54 "Cargo.lock merge=binary"
55
56 "*.css diff=css"
57
58 "*.md diff=markdown"
59
60 "flake.lock merge=binary"
61
62 "yarn.lock merge=binary"
63
64 "*.lockb diff=lockb"
65 ];
66
67 ignores = inputs.self.lib.readFileWithComments ./git/ignore;
68
69 aliases = {
70 b = "branch";
71 ca = "commit --amend";
72 ci = "commit";
73 co = "checkout";
74 rci = "commit --amend --reuse-message HEAD";
75
76 lg = "log --color --graph --abbrev-commit --pretty=simple-oneline";
77
78 squash = "!git rebase -i \"$(git merge-base HEAD \"$(git default-branch)\")\"";
79
80 st = "status -sb";
81 todo = "grep -Ee '\\\\bTODO:?\\\\b'";
82 fixme = "grep -Ee '\\\\bFIX(ME)?:?\\\\b'";
83
84 default-branch = "!git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|^origin/||'";
85
86 cleanup = "!git branch --format=\"%(if:notequals=*)%(HEAD)%(then)%(if:notequals=\${1:-$(git default-branch)})%(refname:lstrip=2)%(then)%(refname:lstrip=2)%(end)%(end)\" --merged \"\$(git default-branch)\" | xargs -rpxL1 git branch -d";
87 };
88
89 extraConfig = {
90 core.commitGraph = true;
91
92 init.defaultBranch = "master";
93
94 user.useConfigOnly = true;
95
96 merge = {
97 ff = false;
98 conflictstyle = "zdiff3";
99 };
100
101 branch.autoSetupRebase = "always";
102
103 commit = {
104 gpgSign = true;
105 verbose = true;
106 cleanup = "scissors";
107 };
108
109 diff = {
110 indentHeuristic = true;
111 algorithm = "histogram";
112 mnemonicPrefix = true;
113 renames = "copies";
114
115 tool = "difftastic";
116
117 markdown.xfuncname = "^(#+\\s+.*)$";
118
119 lockb = {
120 textconv = "${pkgs.bun}/bin/bun";
121 binary = true;
122 };
123 };
124
125 difftool = {
126 prompt = false;
127
128 difftastic.cmd = "${pkgs.difftastic}/bin/difft \"$LOCAL\" \"$REMOTE\"";
129 };
130
131 pager.difftool = true;
132
133 fetch.prune = true;
134
135 tag = {
136 forceSignAnnotated = true;
137 sort = "version:refname";
138 };
139
140 versionsort.suffix = ["" "-rc" "-pre"];
141
142 push = {
143 default = "simple";
144 autoSetupRemote = true;
145 followTags = true;
146 gpgSign = "if-asked";
147 };
148
149 pull = {
150 rebase = true;
151 twohead = "ort";
152 };
153
154 rebase = {
155 autostash = true;
156 autosquash = true;
157 updateRefs = true;
158 };
159
160 url."git@github.com:".pushInsteadOf = "https://github.com/";
161
162 sendemail = {
163 smtpserver = "${config.programs.msmtp.package}/bin/msmtp";
164 bcc = config.accounts.email.accounts.hauleth.address;
165 annotate = true;
166 };
167
168 maintenance = {
169 # It will ask 1password for access to SSH key/GH token. That is
170 # irritating
171 prefetch.enabled = false;
172 };
173
174 pretty = {
175 simple-oneline = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset))";
176 simple-oneline-sign = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset)) %G?";
177 };
178
179 branchless."revsets.alias".work = "heads(draft())";
180 };
181 };
182}