Skyler Grey | d4c4867 | 2022-08-04 16:19:48 +0100 | [diff] [blame] | 1 | { pkgs, git-confirm, ... }: { |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 2 | programs.git = { |
| 3 | enable = true; |
| 4 | |
Skyler Turner | f6fc558 | 2022-05-15 19:16:00 +0100 | [diff] [blame] | 5 | userName = "Skyler Grey"; |
Skyler Grey | d982c4e | 2022-05-23 09:41:16 +0100 | [diff] [blame] | 6 | userEmail = "skyler3665@gmail.com"; |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 7 | |
| 8 | signing = { |
Skyler Grey | 2c395d3 | 2022-05-23 09:44:14 +0100 | [diff] [blame] | 9 | key = "A773 0F0B 1D2C 7E65 DFCB C536 8BE7 C115 369E 52A1"; |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 10 | signByDefault = true; |
| 11 | gpgPath = "gpg2"; |
| 12 | }; |
| 13 | |
| 14 | lfs.enable = true; |
| 15 | delta.enable = true; |
| 16 | |
Skyler Grey | 1196d74 | 2022-08-03 14:07:13 +0100 | [diff] [blame] | 17 | aliases = { |
| 18 | recommit = "!git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG"; |
Skyler Grey | 83e352d | 2022-08-06 10:48:08 +0100 | [diff] [blame] | 19 | 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 Grey | fceb669 | 2022-08-12 16:56:59 +0100 | [diff] [blame^] | 25 | 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 Grey | 1196d74 | 2022-08-03 14:07:13 +0100 | [diff] [blame] | 34 | }; |
| 35 | |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 36 | extraConfig = { |
| 37 | init.defaultBranch = "development"; |
| 38 | color.ui = "auto"; |
| 39 | core.autocrlf = "input"; |
Skyler Grey | 8dee1c0 | 2022-08-01 09:36:38 +0100 | [diff] [blame] | 40 | pull.rebase = "merges"; |
Skyler Turner | 63572a5 | 2022-05-10 15:28:29 +0100 | [diff] [blame] | 41 | credential.helper = "store"; |
Skyler Grey | 5db7040 | 2022-07-26 22:31:16 +0100 | [diff] [blame] | 42 | commit.signOff = true; |
Skyler Grey | 62e6ae1 | 2022-08-02 08:30:04 +0100 | [diff] [blame] | 43 | core.splitIndex = true; |
| 44 | core.untrackedCache = true; |
| 45 | core.fsmonitor = true; |
Skyler Grey | dd2769d | 2022-08-04 16:23:45 +0100 | [diff] [blame] | 46 | hooks.confirm.match = [ "TODO" "FIXME" "HACK" "BUG" "XXX" "LAZY" ]; |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 47 | }; |
| 48 | }; |
Skyler Grey | edd2605 | 2022-07-29 13:17:52 +0100 | [diff] [blame] | 49 | |
Skyler Grey | d4c4867 | 2022-08-04 16:19:48 +0100 | [diff] [blame] | 50 | home.file.".config/git/hooks/pre-commit".source = "${git-confirm}/hook.sh"; |
| 51 | |
Skyler Grey | edd2605 | 2022-07-29 13:17:52 +0100 | [diff] [blame] | 52 | home.packages = [ |
| 53 | pkgs.git-review |
Skyler Grey | fceb669 | 2022-08-12 16:56:59 +0100 | [diff] [blame^] | 54 | pkgs.lazygit |
Skyler Grey | edd2605 | 2022-07-29 13:17:52 +0100 | [diff] [blame] | 55 | ]; |
Skyler Turner | 63572a5 | 2022-05-10 15:28:29 +0100 | [diff] [blame] | 56 | } |