Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs, ... }: { |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 2 | home = { |
Skyler Grey | 97c4c52 | 2023-01-26 00:48:56 +0000 | [diff] [blame] | 3 | home.sessionVariables.CARGO_NET_GIT_FETCH_WITH_CLI = "true"; |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 4 | programs.git = { |
| 5 | enable = true; |
| 6 | |
| 7 | userName = "Skyler Grey"; |
| 8 | userEmail = "skyler3665@gmail.com"; |
| 9 | |
| 10 | signing = { |
| 11 | key = "A773 0F0B 1D2C 7E65 DFCB C536 8BE7 C115 369E 52A1"; |
| 12 | signByDefault = true; |
| 13 | gpgPath = "gpg2"; |
| 14 | }; |
| 15 | |
| 16 | lfs.enable = true; |
| 17 | delta.enable = true; |
| 18 | |
| 19 | aliases = { |
Skyler Grey | 2c3dcd5 | 2023-02-13 07:56:55 +0000 | [diff] [blame] | 20 | recommit = "!git commit --verbose -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG"; |
Skyler Grey | 97c4c52 | 2023-01-26 00:48:56 +0000 | [diff] [blame] | 21 | # Yes, this does need to start with an !. Removing it will make the |
| 22 | # expansion in the middle not work |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 23 | stash-working = '' |
| 24 | !f() { |
| 25 | git commit --quiet --no-verify -m \"temp for stash-working\" && \ |
| 26 | git stash push \"$@\" && \ |
| 27 | git reset --quiet --soft HEAD~1; |
| 28 | }; f''; # https://stackoverflow.com/a/60875082/12293760 |
| 29 | gui = '' |
| 30 | !f() { |
| 31 | export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir |
| 32 | lazygit "$@" |
| 33 | if [ -f $LAZYGIT_NEW_DIR_FILE ]; then |
| 34 | cd "$(cat $LAZYGIT_NEW_DIR_FILE)" |
| 35 | rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null |
| 36 | fi |
| 37 | }; f''; |
Skyler Grey | 97c4c52 | 2023-01-26 00:48:56 +0000 | [diff] [blame] | 38 | graph = ''log --graph --oneline --decorate''; |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | extraConfig = { |
| 42 | init.defaultBranch = "development"; |
| 43 | color.ui = "auto"; |
| 44 | core.autocrlf = "input"; |
| 45 | pull.rebase = "merges"; |
| 46 | credential.helper = "store"; |
| 47 | commit.signOff = true; |
| 48 | core.splitIndex = true; |
| 49 | core.untrackedCache = true; |
| 50 | core.fsmonitor = true; |
Skyler Grey | d810dca | 2022-10-31 00:10:07 +0000 | [diff] [blame] | 51 | url."ssh://git@github.com/".insteadOf = "https://github.com/"; |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 52 | }; |
| 53 | }; |
Skyler Grey | b3741b4 | 2022-09-11 00:50:14 +0100 | [diff] [blame] | 54 | home = { |
| 55 | shellAliases.gg = "${pkgs.git}/bin/git gui"; |
Skyler Grey | d810dca | 2022-10-31 00:10:07 +0000 | [diff] [blame] | 56 | packages = with pkgs; [ |
| 57 | git-review |
| 58 | lazygit |
| 59 | git-crypt |
Skyler Grey | b3741b4 | 2022-09-11 00:50:14 +0100 | [diff] [blame] | 60 | ]; |
| 61 | }; |
Skyler Grey | 3e6779c | 2022-09-01 23:48:49 +0100 | [diff] [blame] | 62 | }; |
| 63 | } |