blob: b3cd59c839f2fb299a2d995cfd90422b028fec2e [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 Grey1196d742022-08-03 14:07:13 +010025 };
26
Skyler Turner62330c12022-03-04 22:10:16 +000027 extraConfig = {
28 init.defaultBranch = "development";
29 color.ui = "auto";
30 core.autocrlf = "input";
Skyler Grey8dee1c02022-08-01 09:36:38 +010031 pull.rebase = "merges";
Skyler Turner63572a52022-05-10 15:28:29 +010032 credential.helper = "store";
Skyler Grey5db70402022-07-26 22:31:16 +010033 commit.signOff = true;
Skyler Grey62e6ae12022-08-02 08:30:04 +010034 core.splitIndex = true;
35 core.untrackedCache = true;
36 core.fsmonitor = true;
Skyler Greydd2769d2022-08-04 16:23:45 +010037 hooks.confirm.match = [ "TODO" "FIXME" "HACK" "BUG" "XXX" "LAZY" ];
Skyler Turner62330c12022-03-04 22:10:16 +000038 };
39 };
Skyler Greyedd26052022-07-29 13:17:52 +010040
Skyler Greyd4c48672022-08-04 16:19:48 +010041 home.file.".config/git/hooks/pre-commit".source = "${git-confirm}/hook.sh";
42
Skyler Greyedd26052022-07-29 13:17:52 +010043 home.packages = [
44 pkgs.git-review
45 ];
Skyler Turner63572a52022-05-10 15:28:29 +010046}