blob: d053f3e64732ae3e370141e22d918b0c09ef85f0 [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";
Skyler Grey4ee78ad2023-03-07 13:14:23 +000046 push.autoSetupRemote = true;
Skyler Grey3e6779c2022-09-01 23:48:49 +010047 credential.helper = "store";
48 commit.signOff = true;
49 core.splitIndex = true;
50 core.untrackedCache = true;
51 core.fsmonitor = true;
Skyler Greyd810dca2022-10-31 00:10:07 +000052 url."ssh://git@github.com/".insteadOf = "https://github.com/";
Skyler Grey3e6779c2022-09-01 23:48:49 +010053 };
54 };
Skyler Greyb3741b42022-09-11 00:50:14 +010055 home = {
56 shellAliases.gg = "${pkgs.git}/bin/git gui";
Skyler Grey13c75102023-02-26 12:08:40 +000057 shellAliases.gs = "${pkgs.git}/bin/git status";
Skyler Grey537932e2023-03-26 11:17:32 +000058 shellAliases.grc = "${pkgs.git}/bin/git recommit";
59 shellAliases.grca = "${pkgs.git}/bin/git recommit --amend";
Skyler Greyd810dca2022-10-31 00:10:07 +000060 packages = with pkgs; [
61 git-review
62 lazygit
63 git-crypt
Skyler Greyb3741b42022-09-11 00:50:14 +010064 ];
65 };
Skyler Grey3e6779c2022-09-01 23:48:49 +010066 };
67}