blob: 80a2c2ca7b6d170a476a26050691f861f39d7220 [file] [log] [blame]
Skyler Grey3e6779c2022-09-01 23:48:49 +01001{pkgs, ...}: {
2 home = {
3 programs.git = {
4 enable = true;
5
6 userName = "Skyler Grey";
7 userEmail = "skyler3665@gmail.com";
8
9 signing = {
10 key = "A773 0F0B 1D2C 7E65 DFCB C536 8BE7 C115 369E 52A1";
11 signByDefault = true;
12 gpgPath = "gpg2";
13 };
14
15 lfs.enable = true;
16 delta.enable = true;
17
18 aliases = {
19 recommit = "!git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG";
20 stash-working = ''
21 !f() {
22 git commit --quiet --no-verify -m \"temp for stash-working\" && \
23 git stash push \"$@\" && \
24 git reset --quiet --soft HEAD~1;
25 }; f''; # https://stackoverflow.com/a/60875082/12293760
26 gui = ''
27 !f() {
28 export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
29 lazygit "$@"
30 if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
31 cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
32 rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
33 fi
34 }; f'';
35 };
36
37 extraConfig = {
38 init.defaultBranch = "development";
39 color.ui = "auto";
40 core.autocrlf = "input";
41 pull.rebase = "merges";
42 credential.helper = "store";
43 commit.signOff = true;
44 core.splitIndex = true;
45 core.untrackedCache = true;
46 core.fsmonitor = true;
47 };
48 };
49 home.packages = [
50 pkgs.git-review
51 pkgs.lazygit
52 ];
53 };
54}