/
default.nix
116 lines (95 loc) · 2.93 KB
/
default.nix
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
107
108
109
110
111
112
113
114
115
116
{ pkgs, ... }:
let
lazygit-config =
if pkgs.stdenv.isDarwin
then "Library/Application Support/jesseduffield/lazygit/config.yml"
else ".config/jesseduffield/lazygit/config.yml";
in
{
programs.git = {
enable = true;
userName = "Brian Hicks";
userEmail = "brian@brianthicks.com";
aliases = {
aa = "add --all";
amend = "commit --amend";
ci = "commit";
co = "checkout";
dc = "diff --cached";
di = "diff";
st = "status";
yoda = "push --force-with-lease";
root = "rev-parse --show-toplevel";
};
extraConfig = {
# after upgrading to 21.11 I suddently need to explicitly set an SSH command
# to connect a port other than :22. How weird! Fortunately it's easy to work
# around with this but I'm not happy with it. Maybe someday I'll figure this
# out and come back and remove this line.
core.sshCommand = "ssh";
core.fsmonitor = "true";
init.defaultBranch = "main";
# make `git push` automatically do `-u origin`
push.autoSetupRemote = true;
rerere.enabled = true;
"filter \"lfs\"" = {
clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f";
smudge = "${pkgs.git-lfs}/bin/git-lfs smudge -- %f";
process = "${pkgs.git-lfs}/bin/git-lfs filter-process";
required = true;
};
};
ignores = [ ".direnv" ".DS_Store" ];
delta = {
enable = true;
options = {
syntax-theme = "1337";
plus-color = "#32473d";
minus-color = "#643632";
features = "line-numbers";
whitespace-error-style = "22 reverse";
};
};
signing = {
key = null;
signByDefault = true;
};
};
programs.gh.enable = true;
home.file."${lazygit-config}".text = builtins.toJSON {
reporting = "off";
startupPopupVersion = 1;
update.method = "never"; # managed through nixpkgs
keybindings = {
universal.return = "q";
universal.createRebaseOptionsMenu = "M";
branches.mergeIntoCurrentBranch = "m";
};
gui.theme = {
lightTheme = false;
activeBorderColor = [ "green" "bold" ];
inactiveBorderColor = [ "white" ];
optionsTextColor = [ "blue" ];
# the default highlighted color is a very bright blue that doesn't have
# sufficient contrast with the foreground.
selectedLineBgColor = [ "bold" ];
selectedRangeBgColor = [ "black" "bold" ];
};
git.paging = {
colorArg = "always";
pager = "${pkgs.gitAndTools.delta}/bin/delta --paging=never";
};
git.overrideGpg = true; # prevents spawning a separate process on commits
# my SSH agent (1password) currently spams auth prompts when using lazygit, so
# I'm turning off auto-fetch stuff, hopefully temporarily!
git.autoFetch = false;
git.autoRefresh = false;
};
home.packages = [
pkgs.gh
pkgs.git-gclone
pkgs.git-lfs
pkgs.gitAndTools.delta
pkgs.lazygit
];
}