blob: 459e25cedbf89df402033a243807a700ea16418f [file] [log] [blame]
Skyler Grey252927a2022-10-18 22:18:15 +01001{ pkgs, ... }: {
Skyler Grey3e6779c2022-09-01 23:48:49 +01002 home = {
Skyler Grey97c4c522023-01-26 00:48:56 +00003 home.sessionVariables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
Skyler Grey3e6779c2022-09-01 23:48:49 +01004 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 Grey2c3dcd52023-02-13 07:56:55 +000020 recommit = "!git commit --verbose -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG";
Skyler Grey97c4c522023-01-26 00:48:56 +000021 # Yes, this does need to start with an !. Removing it will make the
22 # expansion in the middle not work
Skyler Grey3e6779c2022-09-01 23:48:49 +010023 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 Grey97c4c522023-01-26 00:48:56 +000038 graph = ''log --graph --oneline --decorate'';
Skyler Grey3e6779c2022-09-01 23:48:49 +010039 };
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 Greyd810dca2022-10-31 00:10:07 +000051 url."ssh://git@github.com/".insteadOf = "https://github.com/";
Skyler Grey3e6779c2022-09-01 23:48:49 +010052 };
53 };
Skyler Greyb3741b42022-09-11 00:50:14 +010054 home = {
55 shellAliases.gg = "${pkgs.git}/bin/git gui";
Skyler Greyd810dca2022-10-31 00:10:07 +000056 packages = with pkgs; [
57 git-review
58 lazygit
59 git-crypt
Skyler Greyb3741b42022-09-11 00:50:14 +010060 ];
61 };
Skyler Grey3e6779c2022-09-01 23:48:49 +010062 };
63}