blob: e0cb0e2f7e3c358f02af0bd5c84e0c3b3529244d [file] [log] [blame]
Skyler Greyd4c48672022-08-04 16:19:48 +01001{ pkgs, git-confirm, ... }: {
Skyler Turner62330c12022-03-04 22:10:16 +00002 programs.git = {
3 enable = true;
4
Skyler Turnerf6fc5582022-05-15 19:16:00 +01005 userName = "Skyler Grey";
Skyler Greyd982c4e2022-05-23 09:41:16 +01006 userEmail = "skyler3665@gmail.com";
Skyler Turner62330c12022-03-04 22:10:16 +00007
8 signing = {
Skyler Grey2c395d32022-05-23 09:44:14 +01009 key = "A773 0F0B 1D2C 7E65 DFCB C536 8BE7 C115 369E 52A1";
Skyler Turner62330c12022-03-04 22:10:16 +000010 signByDefault = true;
11 gpgPath = "gpg2";
12 };
13
14 lfs.enable = true;
15 delta.enable = true;
16
Skyler Grey1196d742022-08-03 14:07:13 +010017 aliases = {
18 recommit = "!git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG";
Skyler Grey83e352d2022-08-06 10:48:08 +010019 stash-working = ''
20 !f() {
21 git commit --quiet --no-verify -m \"temp for stash-working\" && \
22 git stash push \"$@\" && \
23 git reset --quiet --soft HEAD~1;
24 }; f''; # https://stackoverflow.com/a/60875082/12293760
Skyler Greyfceb6692022-08-12 16:56:59 +010025 gui = ''
26 !f() {
27 export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
28 lazygit "$@"
29 if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
30 cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
31 rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
32 fi
33 }; f'';
Skyler Grey1196d742022-08-03 14:07:13 +010034 };
35
Skyler Turner62330c12022-03-04 22:10:16 +000036 extraConfig = {
37 init.defaultBranch = "development";
38 color.ui = "auto";
39 core.autocrlf = "input";
Skyler Grey8dee1c02022-08-01 09:36:38 +010040 pull.rebase = "merges";
Skyler Turner63572a52022-05-10 15:28:29 +010041 credential.helper = "store";
Skyler Grey5db70402022-07-26 22:31:16 +010042 commit.signOff = true;
Skyler Grey62e6ae12022-08-02 08:30:04 +010043 core.splitIndex = true;
44 core.untrackedCache = true;
45 core.fsmonitor = true;
Skyler Greydd2769d2022-08-04 16:23:45 +010046 hooks.confirm.match = [ "TODO" "FIXME" "HACK" "BUG" "XXX" "LAZY" ];
Skyler Turner62330c12022-03-04 22:10:16 +000047 };
48 };
Skyler Greyedd26052022-07-29 13:17:52 +010049
Skyler Greyd4c48672022-08-04 16:19:48 +010050 home.file.".config/git/hooks/pre-commit".source = "${git-confirm}/hook.sh";
51
Skyler Greyedd26052022-07-29 13:17:52 +010052 home.packages = [
53 pkgs.git-review
Skyler Greyfceb6692022-08-12 16:56:59 +010054 pkgs.lazygit
Skyler Greyedd26052022-07-29 13:17:52 +010055 ];
Skyler Turner63572a52022-05-10 15:28:29 +010056}