Kieran's opinionated (and probably slightly dumb) nix config
1{ lib, config, ... }:
2{
3 options.atelier.shell.git.enable = lib.mkEnableOption {
4 description = "Enable global Git configuration";
5 };
6 config = lib.mkIf config.atelier.shell.git.enable {
7 programs.git = {
8 enable = true;
9 userName = "Kieran Klukas";
10 userEmail = "me@dunkirk.sh";
11 aliases = {
12 c = "commit";
13 p = "push";
14 ch = "checkout";
15 pushfwl = "push --force-with-lease --force-if-includes";
16 };
17 extraConfig = {
18 branch.sort = "-committerdate";
19 pager.branch = false;
20 column.ui = "auto";
21 commit.gpgsign = true;
22 gpg.format = "ssh";
23 gpg.ssh.allowedSignersFile = "~/.ssh/allowedSigners";
24 user.signingKey = "~/.ssh/id_rsa.pub";
25 pull.rebase = true;
26 push.autoSetupRemote = true;
27 init.defaultBranch = "main";
28 };
29 delta.enable = true;
30 };
31 programs.gh.enable = true;
32 programs.lazygit = {
33 enable = true;
34 settings = {
35 gui.theme = {
36 lightTheme = false;
37 activeBorderColor = [
38 "blue"
39 "bold"
40 ];
41 inactiveBorderColor = [ "black" ];
42 selectedLineBgColor = [ "default" ];
43 };
44 };
45 };
46 programs.gh-dash = {
47 enable = true;
48 settings = {
49 prSections = [
50 {
51 title = "Mine";
52 filters = "is:open author:@me updated:>={{ nowModify \"-3w\" }} sort:updated-desc archived:false";
53 layout.author.hidden = true;
54 }
55 {
56 title = "Review";
57 filters = "sort:updated-desc is:pr is:open review-requested:taciturnaxolotl archived:false";
58 }
59 {
60 title = "All";
61 filters = "sort:updated-desc is:pr is:open user:@me archived:false";
62 }
63 ];
64 issuesSections = [
65 {
66 title = "Open";
67 filters = "user:@me is:open archived:false -author:@me sort:updated-desc";
68 }
69 {
70 title = "Assigned";
71 filters = "is:issue state:open archived:false assignee:@me sort:updated-desc ";
72 }
73 {
74 title = "Creator";
75 filters = "author:@me is:open archived:false";
76 }
77 {
78 title = "Hackclub";
79 filters = "is:issue org:hackclub archived:false involves:@me sort:updated-desc is:open";
80 }
81 {
82 title = "All";
83 filters = "is:issue involves:@me archived:false sort:updated-desc is:open";
84 }
85 ];
86 pager.diff = "diffnav";
87 defaults = {
88 view = "prs";
89 refetchIntervalMinutes = 5;
90 layout.prs = {
91 repoName = {
92 grow = true;
93 width = 10;
94 hidden = false;
95 };
96 base.hidden = true;
97 };
98 preview = {
99 open = true;
100 width = 84;
101 };
102 prsLimit = 20;
103 issuesLimit = 20;
104 };
105 repoPaths = {
106 "taciturnaxolotl/*" = "~/code/personal/*";
107 "hackclub/*" = "~/code/hackclub/*";
108 };
109 keybindings = {
110 universal = [
111 {
112 key = "g";
113 name = "lazygit";
114 command = "cd {{.RepoPath}} && lazygit";
115 }
116 ];
117 prs = [
118 {
119 key = "O";
120 builtin = "checkout";
121 }
122 {
123 key = "m";
124 command = "gh pr merge --admin --repo {{.RepoName}} {{.PrNumber}}";
125 }
126 {
127 key = "C";
128 name = "code review";
129 command = "tmux new-window -c {{.RepoPath}} 'nvim -c \":silent Octo pr edit {{.PrNumber}}\"'";
130 }
131 {
132 key = "a";
133 name = "lazygit add";
134 command = "cd {{.RepoPath}} && git add -A && lazygit";
135 }
136 {
137 key = "v";
138 name = "approve";
139 command = "gh pr review --repo {{.RepoName}} --approve --body \"$(gum input --prompt='Approval Comment: ')\" {{.PrNumber}}";
140 }
141 ];
142 };
143 theme = {
144 ui = {
145 sectionsShowCount = true;
146 table.compact = false;
147 };
148 };
149 };
150 };
151 };
152}